From aee8a2661e1f53c8646a8bc9bca14531b27137bd Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Fri, 11 Feb 2022 09:48:54 +1000 Subject: [PATCH] Fix Copy Verification Code not showing after first log in (#1459) * Move init logic to load() --- src/app/vault/ciphers.component.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/app/vault/ciphers.component.ts b/src/app/vault/ciphers.component.ts index 69ad0186..23b7f066 100644 --- a/src/app/vault/ciphers.component.ts +++ b/src/app/vault/ciphers.component.ts @@ -55,14 +55,17 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy super(searchService); } - async ngOnInit() { - this.userHasPremiumAccess = await this.stateService.getCanAccessPremium(); - } - ngOnDestroy() { this.selectAll(false); } + // load() is called after the page loads and the first sync has completed. + // Do not use ngOnInit() for anything that requires sync data. + async load(filter: (cipher: CipherView) => boolean = null, deleted: boolean = false) { + await super.load(filter, deleted); + this.userHasPremiumAccess = await this.stateService.getCanAccessPremium(); + } + loadMore() { if (this.ciphers.length <= this.pageSize) { return;