Skip to content

Commit

Permalink
fix: glitch on logout and re-login db get cleaned and fail on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
geolffreym committed Apr 30, 2021
1 parent ac7c182 commit 121ad80
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/core/broker/broker.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,17 @@ module.exports = class Broker extends EventEmitter {
constructor(renderer) {
super()
this.renderer = renderer;
this.db = new LinvoDB(DB)//, MOVIES_SCHEMA, {})

}

initDB() {
/**
* Initialize db
* @type {function(*=): void}
*/
log.warn('Creating local db')
this.db = new LinvoDB(DB)//, MOVIES_SCHEMA, {})
}

flush() {
/**
Expand Down Expand Up @@ -183,6 +191,7 @@ module.exports = class Broker extends EventEmitter {
*/
// Clean old listeners first
log.info('Broker ready')
this.initDB();
this.stopIpcEvents();
this.emitStart();
this.listenForPartyRock();
Expand Down

0 comments on commit 121ad80

Please sign in to comment.