diff --git a/jslib b/jslib index d37fa836da5..a360cd8e61d 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit d37fa836da523ae69413881f4af929c6808a688b +Subproject commit a360cd8e61d9228b14de86ca5469c694492c4a87 diff --git a/src/background/main.background.ts b/src/background/main.background.ts index 0a6dfec0280..c4dafb2602c 100644 --- a/src/background/main.background.ts +++ b/src/background/main.background.ts @@ -144,6 +144,9 @@ export default class MainBackground { this.lockService = new LockService(this.cipherService, this.folderService, this.collectionService, this.cryptoService, this.platformUtilsService, this.storageService, this.messagingService, this.searchService, async () => { + if (this.notificationsService != null) { + this.notificationsService.updateConnection(); + } await this.setIcon(); await this.refreshBadgeAndMenu(true); }); @@ -157,8 +160,8 @@ export default class MainBackground { this.containerService = new ContainerService(this.cryptoService, this.platformUtilsService); this.auditService = new AuditService(cryptoFunctionService, this.apiService); this.exportService = new ExportService(this.folderService, this.cipherService, this.apiService); - this.notificationsService = new NotificationsService(this.userService, this.tokenService, - this.syncService, this.appIdService, this.apiService); + this.notificationsService = new NotificationsService(this.userService, this.syncService, this.appIdService, + this.apiService, this.cryptoService); this.environmentService = new EnvironmentService(this.apiService, this.storageService, this.notificationsService); this.analytics = new Analytics(window, () => BrowserApi.gaFilter(), this.platformUtilsService, diff --git a/src/background/runtime.background.ts b/src/background/runtime.background.ts index 0cd5aa92036..cc212b2a008 100644 --- a/src/background/runtime.background.ts +++ b/src/background/runtime.background.ts @@ -80,14 +80,11 @@ export default class RuntimeBackground { async processMessage(msg: any, sender: any, sendResponse: any) { switch (msg.command) { case 'loggedIn': - await this.main.setIcon(); - await this.main.refreshBadgeAndMenu(false); - this.notificationsService.updateConnection(); - break; case 'unlocked': case 'locked': await this.main.setIcon(); await this.main.refreshBadgeAndMenu(msg.command === 'locked'); + this.notificationsService.updateConnection(); break; case 'logout': await this.main.logout(msg.expired);