mirror of
https://github.com/bitwarden/mobile
synced 2025-12-22 11:13:49 +00:00
Support for Disable Send policy (#1271)
* add support for disable send policy * cleanup * show/hide options support for send search results * additional failsafes and copy function consolidation * added missing disabled send icon to android renderer * async fix and string updates
This commit is contained in:
@@ -18,6 +18,7 @@ namespace Bit.App.Pages
|
||||
{
|
||||
public class SendGroupingsPageViewModel : BaseViewModel
|
||||
{
|
||||
private bool _sendEnabled;
|
||||
private bool _refreshing;
|
||||
private bool _doingLoad;
|
||||
private bool _loading;
|
||||
@@ -65,6 +66,11 @@ namespace Bit.App.Pages
|
||||
public bool HasSends { get; set; }
|
||||
public List<SendView> Sends { get; set; }
|
||||
|
||||
public bool SendEnabled
|
||||
{
|
||||
get => _sendEnabled;
|
||||
set => SetProperty(ref _sendEnabled, value);
|
||||
}
|
||||
public bool Refreshing
|
||||
{
|
||||
get => _refreshing;
|
||||
@@ -110,6 +116,11 @@ namespace Bit.App.Pages
|
||||
public Command<SendView> SendOptionsCommand { get; set; }
|
||||
public bool LoadedOnce { get; set; }
|
||||
|
||||
public async Task InitAsync()
|
||||
{
|
||||
SendEnabled = ! await AppHelpers.IsSendDisabledByPolicyAsync();
|
||||
}
|
||||
|
||||
public async Task LoadAsync()
|
||||
{
|
||||
if (_doingLoad)
|
||||
@@ -167,7 +178,11 @@ namespace Bit.App.Pages
|
||||
|
||||
if (Sends?.Any() ?? false)
|
||||
{
|
||||
var sendsListItems = Sends.Select(s => new SendGroupingsPageListItem { Send = s }).ToList();
|
||||
var sendsListItems = Sends.Select(s => new SendGroupingsPageListItem
|
||||
{
|
||||
Send = s,
|
||||
ShowOptions = SendEnabled
|
||||
}).ToList();
|
||||
groupedSends.Add(new SendGroupingsPageListGroup(sendsListItems,
|
||||
MainPage ? AppResources.AllSends : AppResources.Sends, sendsListItems.Count,
|
||||
uppercaseGroupNames, !MainPage));
|
||||
|
||||
Reference in New Issue
Block a user