Skip to content

Commit

Permalink
Issue #24 - Made sure to update sync state in panel whenever necessar…
Browse files Browse the repository at this point in the history
…y, e.g. on master password reset
  • Loading branch information
palant committed Feb 20, 2018
1 parent 8a961f1 commit 053f0c3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

"use strict";

let messaging = require("./messaging");
let storage = require("./storage");
let {lock, STORAGE_PREFIX: passwordsPrefix} = require("./passwords");

Expand Down Expand Up @@ -91,7 +92,8 @@ exports.authorize = function()
syncData = {provider: "dropbox", token};
return Promise.all([
storage.set(dataKey, syncData, null),
tracker.enable()
tracker.enable(),
messaging.getPort("panel").emit("init", {syncProvider: syncData.provider})
]);
}).finally(() => lock.release());
});
Expand All @@ -104,7 +106,8 @@ exports.disable = function()
syncData = null;
return Promise.all([
storage.delete(dataKey),
tracker.disable()
tracker.disable(),
messaging.getPort("panel").emit("init", {syncProvider: null})
]);
}).finally(() => lock.release());
};

0 comments on commit 053f0c3

Please sign in to comment.