mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 23:25:45 +03:00
show attachments properly if an organization
This commit is contained in:
parent
0ffc6e4a1a
commit
8847991bba
1 changed files with 13 additions and 14 deletions
|
@ -49,6 +49,7 @@ namespace Bit.App.Pages
|
|||
public Label FileLabel { get; set; }
|
||||
public ExtendedTableView NewTable { get; set; }
|
||||
public Label NoDataLabel { get; set; }
|
||||
public ToolbarItem SaveToolbarItem { get; set; }
|
||||
|
||||
private void Init()
|
||||
{
|
||||
|
@ -110,11 +111,6 @@ namespace Bit.App.Pages
|
|||
VerticalOptions = LayoutOptions.FillAndExpand
|
||||
};
|
||||
|
||||
if(_tokenService.TokenPremium)
|
||||
{
|
||||
ListView.Footer = NewTable;
|
||||
}
|
||||
|
||||
NoDataLabel = new Label
|
||||
{
|
||||
Text = AppResources.NoAttachments,
|
||||
|
@ -130,7 +126,7 @@ namespace Bit.App.Pages
|
|||
Margin = new Thickness(0, 40, 0, 0)
|
||||
};
|
||||
|
||||
var saveToolBarItem = new ToolbarItem(AppResources.Save, Helpers.ToolbarImage("envelope.png"), async () =>
|
||||
SaveToolbarItem = new ToolbarItem(AppResources.Save, Helpers.ToolbarImage("envelope.png"), async () =>
|
||||
{
|
||||
if(_lastAction.LastActionWasRecent() || _cipher == null)
|
||||
{
|
||||
|
@ -183,11 +179,6 @@ namespace Bit.App.Pages
|
|||
Title = AppResources.Attachments;
|
||||
Content = ListView;
|
||||
|
||||
if(_tokenService.TokenPremium)
|
||||
{
|
||||
ToolbarItems.Add(saveToolBarItem);
|
||||
}
|
||||
|
||||
if(Device.RuntimePlatform == Device.iOS)
|
||||
{
|
||||
ListView.RowHeight = -1;
|
||||
|
@ -209,10 +200,18 @@ namespace Bit.App.Pages
|
|||
ListView.ItemSelected += AttachmentSelected;
|
||||
await LoadAttachmentsAsync();
|
||||
|
||||
if(_tokenService.TokenPremium && !_canUseAttachments)
|
||||
if(_cipher != null && (_tokenService.TokenPremium || _cipher.OrganizationId != null))
|
||||
{
|
||||
await ShowUpdateKeyAsync();
|
||||
ToolbarItems.Add(SaveToolbarItem);
|
||||
ListView.Footer = NewTable;
|
||||
|
||||
if(!_canUseAttachments)
|
||||
{
|
||||
await ShowUpdateKeyAsync();
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: else show alert about needing premium membership
|
||||
}
|
||||
|
||||
protected override void OnDisappearing()
|
||||
|
|
Loading…
Reference in a new issue