diff --git a/jslib b/jslib index 38c26d9649..852b4571b3 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 38c26d9649f613e4f8987e4e4727a0e90a21233b +Subproject commit 852b4571b34d60845f37956e9468f845d9dd627e diff --git a/src/app/vault/vault.component.ts b/src/app/vault/vault.component.ts index 56d4b55cb2..3b05bfead6 100644 --- a/src/app/vault/vault.component.ts +++ b/src/app/vault/vault.component.ts @@ -88,37 +88,20 @@ export class VaultComponent implements OnInit, OnDestroy { async ngOnInit() { this.showVerifyEmail = !(await this.tokenService.getEmailVerified()); this.showBrowserOutdated = window.navigator.userAgent.indexOf('MSIE') !== -1; - const hasEncKey = await this.cryptoService.hasEncKey(); - this.showUpdateKey = !hasEncKey; - const canAccessPremium = await this.userService.canAccessPremium(); this.route.queryParams.subscribe(async (params) => { await this.syncService.fullSync(false); - this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => { - this.ngZone.run(async () => { - switch (message.command) { - case 'syncCompleted': - if (message.successfully) { - await Promise.all([ - this.groupingsComponent.load(), - this.organizationsComponent.load(), - this.ciphersComponent.load(this.ciphersComponent.filter), - ]); - this.changeDetectorRef.detectChanges(); - } - break; - } - }); - }); + + this.showUpdateKey = !(await this.cryptoService.hasEncKey()); + const canAccessPremium = await this.userService.canAccessPremium(); + this.showPremiumCallout = !this.showVerifyEmail && !canAccessPremium && + !this.platformUtilsService.isSelfHost(); await Promise.all([ this.groupingsComponent.load(), this.organizationsComponent.load(), ]); - this.showPremiumCallout = !this.showVerifyEmail && !canAccessPremium && - !this.platformUtilsService.isSelfHost(); - if (params == null) { this.groupingsComponent.selectedAll = true; await this.ciphersComponent.load(); @@ -143,6 +126,23 @@ export class VaultComponent implements OnInit, OnDestroy { this.groupingsComponent.selectedAll = true; await this.ciphersComponent.load(); } + + this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => { + this.ngZone.run(async () => { + switch (message.command) { + case 'syncCompleted': + if (message.successfully) { + await Promise.all([ + this.groupingsComponent.load(), + this.organizationsComponent.load(), + this.ciphersComponent.load(this.ciphersComponent.filter), + ]); + this.changeDetectorRef.detectChanges(); + } + break; + } + }); + }); }); }