reload process on lock

This commit is contained in:
Kyle Spearrin 2019-02-25 16:19:19 -05:00
parent 1be90ce6bd
commit 9792a7ade5
4 changed files with 15 additions and 6 deletions

2
jslib

@ -1 +1 @@
Subproject commit d0a0da8ee9ec4869001be96bc362e537ae15f961
Subproject commit 79c15a18414190ffce39a126ccc9078405287693

View File

@ -149,6 +149,10 @@ export default class MainBackground {
}
await this.setIcon();
await this.refreshBadgeAndMenu(true);
this.lockService.startLockReload();
}, () => {
window.location.reload(true);
return Promise.resolve();
});
this.syncService = new SyncService(this.userService, this.apiService, this.settingsService,
this.folderService, this.cipherService, this.cryptoService, this.collectionService,
@ -174,7 +178,7 @@ export default class MainBackground {
// Background
this.runtimeBackground = new RuntimeBackground(this, this.autofillService, this.cipherService,
this.platformUtilsService as BrowserPlatformUtilsService, this.storageService, this.i18nService,
this.analytics, this.notificationsService);
this.analytics, this.notificationsService, this.lockService);
this.tabsBackground = new TabsBackground(this, this.platformUtilsService);
this.commandsBackground = new CommandsBackground(this, this.passwordGenerationService,
this.platformUtilsService, this.analytics);
@ -284,6 +288,7 @@ export default class MainBackground {
await this.refreshBadgeAndMenu();
await this.reseedStorage();
this.notificationsService.updateConnection(false);
this.lockService.startLockReload();
}
collectPageDetailsForContentScript(tab: any, sender: string, frameId: number = null) {

View File

@ -12,6 +12,7 @@ import { Analytics } from 'jslib/misc';
import {
CipherService,
LockService,
StorageService,
} from 'jslib/abstractions';
@ -36,7 +37,8 @@ export default class RuntimeBackground {
constructor(private main: MainBackground, private autofillService: AutofillService,
private cipherService: CipherService, private platformUtilsService: BrowserPlatformUtilsService,
private storageService: StorageService, private i18nService: I18nService,
private analytics: Analytics, private notificationsService: NotificationsService) {
private analytics: Analytics, private notificationsService: NotificationsService,
private lockService: LockService) {
this.isSafari = this.platformUtilsService.isSafari();
this.runtime = this.isSafari ? safari.application : chrome.runtime;
@ -81,10 +83,10 @@ export default class RuntimeBackground {
switch (msg.command) {
case 'loggedIn':
case 'unlocked':
case 'locked':
await this.main.setIcon();
await this.main.refreshBadgeAndMenu(msg.command === 'locked');
await this.main.refreshBadgeAndMenu(false);
this.notificationsService.updateConnection(msg.command === 'unlocked');
this.lockService.cancelLockReload();
break;
case 'logout':
await this.main.logout(msg.expired);

View File

@ -112,7 +112,9 @@ export class AppComponent implements OnInit {
action: msg.action,
properties: { label: msg.label },
});
} else {
} else if (msg.command === 'reloadProcess') {
window.location.reload(true);
} else {
msg.webExtSender = sender;
this.broadcasterService.send(msg);
}