From 9a040644bf1766c2af21928034c9dc2b53b679a8 Mon Sep 17 00:00:00 2001 From: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com> Date: Sat, 25 Apr 2020 08:13:48 -0500 Subject: [PATCH] Added warning dialog for log out action (#438) --- src/app/accounts/settings.component.ts | 10 ++++++++++ src/locales/en/messages.json | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/src/app/accounts/settings.component.ts b/src/app/accounts/settings.component.ts index b190e4253b..a178e96cd0 100644 --- a/src/app/accounts/settings.component.ts +++ b/src/app/accounts/settings.component.ts @@ -128,6 +128,16 @@ export class SettingsComponent implements OnInit { } async saveVaultTimeoutOptions() { + if (this.vaultTimeoutAction === 'logOut') { + const confirmed = await this.platformUtilsService.showDialog( + this.i18nService.t('vaultTimeoutLogOutConfirmation'), + this.i18nService.t('vaultTimeoutLogOutConfirmationTitle'), + this.i18nService.t('yes'), this.i18nService.t('cancel'), 'warning'); + if (!confirmed) { + this.vaultTimeoutAction = 'lock'; + return; + } + } await this.vaultTimeoutService.setVaultTimeoutOptions(this.vaultTimeout != null ? this.vaultTimeout : null, this.vaultTimeoutAction); } diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index 4e35b8567f..64fb8a4149 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -1298,5 +1298,11 @@ "lock": { "message": "Lock", "description": "Verb form: to make secure or inaccesible by" + }, + "vaultTimeoutLogOutConfirmation": { + "message": "Logging out will remove all access to your vault and requires online authentication after the timeout period. Are you sure you want to use this setting?" + }, + "vaultTimeoutLogOutConfirmationTitle": { + "message": "Timeout Action Confirmation" } }