From 37e46dab48ce417a009a41a7d689b71238dba998 Mon Sep 17 00:00:00 2001 From: Gbubemi Smith Date: Fri, 24 Jun 2022 23:19:55 +0100 Subject: [PATCH] [PS-968] regression bug fix on custom timeout switch for the browser (#2969) * regression bug fix on custom timeout switch for the browser * regression bug fix on custom timeout switch for the browser * locale key fix * suggestion fixes --- apps/browser/src/_locales/en/messages.json | 2 +- .../src/popup/settings/settings.component.ts | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json index 8fcb5822a7..63464b4de8 100644 --- a/apps/browser/src/_locales/en/messages.json +++ b/apps/browser/src/_locales/en/messages.json @@ -1846,7 +1846,7 @@ } } }, - "vaultTimeoutToLarge": { + "vaultTimeoutTooLarge": { "message": "Your vault timeout exceeds the restrictions set by your organization." }, "vaultExportDisabled": { diff --git a/apps/browser/src/popup/settings/settings.component.ts b/apps/browser/src/popup/settings/settings.component.ts index b0c74d9c32..0905e48157 100644 --- a/apps/browser/src/popup/settings/settings.component.ts +++ b/apps/browser/src/popup/settings/settings.component.ts @@ -135,8 +135,14 @@ export class SettingsComponent implements OnInit { } } - if (!this.vaultTimeout.valid) { - this.platformUtilsService.showToast("error", null, this.i18nService.t("vaultTimeoutToLarge")); + // The minTimeoutError does not apply to browser because it supports Immediately + // So only check for the policyError + if (this.vaultTimeout.hasError("policyError")) { + this.platformUtilsService.showToast( + "error", + null, + this.i18nService.t("vaultTimeoutTooLarge") + ); return; } @@ -171,8 +177,12 @@ export class SettingsComponent implements OnInit { } } - if (!this.vaultTimeout.valid) { - this.platformUtilsService.showToast("error", null, this.i18nService.t("vaultTimeoutToLarge")); + if (this.vaultTimeout.hasError("policyError")) { + this.platformUtilsService.showToast( + "error", + null, + this.i18nService.t("vaultTimeoutTooLarge") + ); return; }