premium message on attachments edit page

This commit is contained in:
Kyle Spearrin 2018-02-12 08:54:31 -05:00
parent aeb01ba292
commit 884521ced0

View file

@ -200,6 +200,16 @@ namespace Bit.App.Pages
ListView.ItemSelected += AttachmentSelected; ListView.ItemSelected += AttachmentSelected;
await LoadAttachmentsAsync(); await LoadAttachmentsAsync();
// Prevent from adding multiple save buttons
if(Device.RuntimePlatform == Device.iOS && ToolbarItems.Count > 1)
{
ToolbarItems.RemoveAt(1);
}
else if(Device.RuntimePlatform != Device.iOS && ToolbarItems.Count > 0)
{
ToolbarItems.RemoveAt(0);
}
if(_cipher != null && (_tokenService.TokenPremium || _cipher.OrganizationId != null)) if(_cipher != null && (_tokenService.TokenPremium || _cipher.OrganizationId != null))
{ {
ToolbarItems.Add(SaveToolbarItem); ToolbarItems.Add(SaveToolbarItem);
@ -210,8 +220,10 @@ namespace Bit.App.Pages
await ShowUpdateKeyAsync(); await ShowUpdateKeyAsync();
} }
} }
else
// TODO: else show alert about needing premium membership {
await DisplayAlert(null, AppResources.PremiumRequired, AppResources.Ok);
}
} }
protected override void OnDisappearing() protected override void OnDisappearing()