1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 23:03:32 +00:00

warn user and reseed storage if using Never lock option

This commit is contained in:
Kyle Spearrin
2018-10-03 22:46:11 -04:00
parent ba67561c9e
commit d16d1d1308
4 changed files with 32 additions and 13 deletions

View File

@@ -137,6 +137,9 @@ export default class RuntimeBackground {
case 'bgUpdateContextMenu':
await this.main.refreshBadgeAndMenu();
break;
case 'bgReseedStorage':
await this.reseedStorage();
break;
case 'collectPageDetailsResponse':
switch (msg.sender) {
case 'notificationBar':
@@ -373,8 +376,6 @@ export default class RuntimeBackground {
if (this.onInstalledReason === 'install') {
BrowserApi.createNewTab('https://bitwarden.com/browser-start/');
await this.setDefaultSettings();
} else if (this.onInstalledReason === 'update') {
await this.reseedStorage();
}
this.analytics.ga('send', {
@@ -397,12 +398,6 @@ export default class RuntimeBackground {
return;
}
const reseed124Key = 'reseededStorage124';
const reseeded124 = await this.storageService.get<boolean>(reseed124Key);
if (reseeded124) {
return;
}
const getStorage = (): Promise<any> => new Promise((resolve) => {
chrome.storage.local.get(null, (o: any) => resolve(o));
});
@@ -418,11 +413,8 @@ export default class RuntimeBackground {
if (!storage.hasOwnProperty(key)) {
continue;
}
await this.storageService.save(key, storage[key]);
}
await this.storageService.save(reseed124Key, true);
}
private async setDefaultSettings() {