1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-06-29 11:05:52 +02:00

premium required for attachment download

This commit is contained in:
Kyle Spearrin 2017-07-21 17:21:04 -04:00
parent 1124c48c8d
commit b32603b472
3 changed files with 22 additions and 4 deletions

View File

@ -277,8 +277,14 @@ namespace Bit.App.Pages
private async Task OpenAttachmentAsync(Login login, VaultViewLoginPageModel.Attachment attachment)
{
// 20 MB warning
if(attachment.Size >= 20971520 && !(await _userDialogs.ConfirmAsync(
if(!_tokenService.TokenPremium && !login.OrganizationUseTotp)
{
_userDialogs.Alert(AppResources.PremiumRequired);
return;
}
// 10 MB warning
if(attachment.Size >= 10485760 && !(await _userDialogs.ConfirmAsync(
string.Format(AppResources.AttachmentLargeWarning, attachment.SizeName), null,
AppResources.Yes, AppResources.No)))
{
@ -314,8 +320,8 @@ namespace Bit.App.Pages
private void Copy(string copyText, string alertLabel)
{
_deviceActionService.CopyToClipboard(copyText);
_userDialogs.Toast(string.Format(AppResources.ValueHasBeenCopied, alertLabel));
_deviceActionService.CopyToClipboard(copyText);
_userDialogs.Toast(string.Format(AppResources.ValueHasBeenCopied, alertLabel));
}
private void TotpTick(string totpKey)

View File

@ -1771,6 +1771,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to A premium membership is required to use this feature..
/// </summary>
public static string PremiumRequired {
get {
return ResourceManager.GetString("PremiumRequired", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to bitwarden keeps your vault automatically synced by using push notifications. For the best possible experience, please select &quot;Ok&quot; on the following prompt when asked to enable push notifications..
/// </summary>

View File

@ -962,4 +962,7 @@
<data name="DisableAutoTotpCopy" xml:space="preserve">
<value>Disable Automatic TOTP Copy</value>
</data>
<data name="PremiumRequired" xml:space="preserve">
<value>A premium membership is required to use this feature.</value>
</data>
</root>