From 8211e19db02a350606a970b828dbb16bc83788bb Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 7 Jun 2018 17:11:17 -0400 Subject: [PATCH] add web device type, dont check password twice --- src/angular/components/add-edit.component.ts | 5 +++++ src/enums/deviceType.ts | 1 + src/misc/analytics.ts | 1 + 3 files changed, 7 insertions(+) diff --git a/src/angular/components/add-edit.component.ts b/src/angular/components/add-edit.component.ts index dced8314a1..5c69e331dc 100644 --- a/src/angular/components/add-edit.component.ts +++ b/src/angular/components/add-edit.component.ts @@ -278,6 +278,10 @@ export class AddEditComponent { } async checkPassword() { + if (this.checkPasswordPromise != null) { + return; + } + if (this.cipher.login == null || this.cipher.login.password == null || this.cipher.login.password === '') { return; } @@ -285,6 +289,7 @@ export class AddEditComponent { this.analytics.eventTrack.next({ action: 'Check Password' }); this.checkPasswordPromise = this.auditService.passwordLeaked(this.cipher.login.password); const matches = await this.checkPasswordPromise; + this.checkPasswordPromise = null; if (matches > 0) { this.toasterService.popAsync('warning', null, this.i18nService.t('passwordExposed', matches.toString())); diff --git a/src/enums/deviceType.ts b/src/enums/deviceType.ts index c41ff92933..e3e2fecb92 100644 --- a/src/enums/deviceType.ts +++ b/src/enums/deviceType.ts @@ -8,4 +8,5 @@ export enum DeviceType { Linux = 8, Vivaldi = 19, Safari = 20, + Web = 21, } diff --git a/src/misc/analytics.ts b/src/misc/analytics.ts index 3ecf1c5b16..7f9f565932 100644 --- a/src/misc/analytics.ts +++ b/src/misc/analytics.ts @@ -18,6 +18,7 @@ export const AnalyticsIds = { [DeviceType.Windows]: 'UA-81915606-17', [DeviceType.Linux]: 'UA-81915606-19', [DeviceType.MacOs]: 'UA-81915606-18', + [DeviceType.Web]: 'UA-81915606-3', }; export class Analytics {