mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
check key and premium after sync
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: 38c26d9649...852b4571b3
@@ -88,37 +88,20 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
|
this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
|
||||||
this.showBrowserOutdated = window.navigator.userAgent.indexOf('MSIE') !== -1;
|
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) => {
|
this.route.queryParams.subscribe(async (params) => {
|
||||||
await this.syncService.fullSync(false);
|
await this.syncService.fullSync(false);
|
||||||
this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => {
|
|
||||||
this.ngZone.run(async () => {
|
this.showUpdateKey = !(await this.cryptoService.hasEncKey());
|
||||||
switch (message.command) {
|
const canAccessPremium = await this.userService.canAccessPremium();
|
||||||
case 'syncCompleted':
|
this.showPremiumCallout = !this.showVerifyEmail && !canAccessPremium &&
|
||||||
if (message.successfully) {
|
!this.platformUtilsService.isSelfHost();
|
||||||
await Promise.all([
|
|
||||||
this.groupingsComponent.load(),
|
|
||||||
this.organizationsComponent.load(),
|
|
||||||
this.ciphersComponent.load(this.ciphersComponent.filter),
|
|
||||||
]);
|
|
||||||
this.changeDetectorRef.detectChanges();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
this.groupingsComponent.load(),
|
this.groupingsComponent.load(),
|
||||||
this.organizationsComponent.load(),
|
this.organizationsComponent.load(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
this.showPremiumCallout = !this.showVerifyEmail && !canAccessPremium &&
|
|
||||||
!this.platformUtilsService.isSelfHost();
|
|
||||||
|
|
||||||
if (params == null) {
|
if (params == null) {
|
||||||
this.groupingsComponent.selectedAll = true;
|
this.groupingsComponent.selectedAll = true;
|
||||||
await this.ciphersComponent.load();
|
await this.ciphersComponent.load();
|
||||||
@@ -143,6 +126,23 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
this.groupingsComponent.selectedAll = true;
|
this.groupingsComponent.selectedAll = true;
|
||||||
await this.ciphersComponent.load();
|
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;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user