[EC-303] Add warning when vault timeout is set to "Never" (#1976)

* Added to AppResources.resx the message warning the user about setting the lockout option to "Never"

* Added the condition to check the newly selected option on the vault timeout settings

* Changed the wording on the warning as to reflect the mobile version

* Changed the vault timeout modal to have the ability to cancel

* Simplified the reversion of value if the user cancels the change
This commit is contained in:
Rui Tomé 2022-07-07 16:35:58 +01:00 committed by GitHub
parent 58a3662d0f
commit cd56a124d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 0 deletions

View File

@ -257,6 +257,17 @@ namespace Bit.App.Pages
}
var cleanSelection = selection.Replace("✓ ", string.Empty);
var selectionOption = _vaultTimeouts.FirstOrDefault(o => o.Key == cleanSelection);
// Check if the selected Timeout action is "Never" and if it's different from the previous selected value
if (selectionOption.Value == null && selectionOption.Value != oldTimeout)
{
var confirmed = await _platformUtilsService.ShowDialogAsync(AppResources.NeverLockWarning,
AppResources.Warning, AppResources.Yes, AppResources.Cancel);
if (!confirmed)
{
return;
}
}
_vaultTimeoutDisplayValue = selectionOption.Key;
newTimeout = selectionOption.Value;
}

View File

@ -4034,5 +4034,13 @@ namespace Bit.App.Resources {
return ResourceManager.GetString("All", resourceCulture);
}
}
public static string NeverLockWarning
{
get
{
return ResourceManager.GetString("NeverLockWarning", resourceCulture);
}
}
}
}

View File

@ -2254,4 +2254,7 @@
<data name="All" xml:space="preserve">
<value>All</value>
</data>
<data name="NeverLockWarning" xml:space="preserve">
<value>Setting your lock options to “Never” keeps your vault available to anyone with access to your device. If you use this option, you should ensure that you keep your device properly protected.</value>
</data>
</root>