From 2cbb7788f435c9529bdc00797e7d746aa231aeee Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 13 Jun 2018 17:19:58 -0400 Subject: [PATCH] use hasKey helper --- src/background/main.background.ts | 4 ++-- src/popup/services/launch-guard.service.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/background/main.background.ts b/src/background/main.background.ts index 901c31ee0f..36f68bc402 100644 --- a/src/background/main.background.ts +++ b/src/background/main.background.ts @@ -210,12 +210,12 @@ export default class MainBackground { } const isAuthenticated = await this.userService.isAuthenticated(); - const key = await this.cryptoService.getKey(); + const hasKey = await this.cryptoService.hasKey(); let suffix = ''; if (!isAuthenticated) { suffix = '_gray'; - } else if (!key) { + } else if (!hasKey) { suffix = '_locked'; } diff --git a/src/popup/services/launch-guard.service.ts b/src/popup/services/launch-guard.service.ts index 0f045482fa..64db076337 100644 --- a/src/popup/services/launch-guard.service.ts +++ b/src/popup/services/launch-guard.service.ts @@ -24,8 +24,8 @@ export class LaunchGuardService implements CanActivate { return true; } - const key = await this.cryptoService.getKey(); - if (key == null) { + const hasKey = await this.cryptoService.hasKey(); + if (!hasKey) { this.router.navigate(['lock']); } else { this.router.navigate(['tabs/current']);