mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +03:00
PM-1615 Fix cipher options not working in lists due to binding failing due to type mismatch. Updated GroupingsPageViewModel to new way of calling as well (#2456)
This commit is contained in:
parent
99ceb8dbc1
commit
120f1d6859
2 changed files with 8 additions and 13 deletions
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Windows.Input;
|
||||||
using Bit.App.Abstractions;
|
using Bit.App.Abstractions;
|
||||||
using Bit.Core.Models.View;
|
using Bit.Core.Models.View;
|
||||||
using Bit.Core.Utilities;
|
using Bit.Core.Utilities;
|
||||||
|
@ -18,7 +19,7 @@ namespace Bit.App.Controls
|
||||||
nameof(WebsiteIconsEnabled), typeof(bool?), typeof(CipherViewCell));
|
nameof(WebsiteIconsEnabled), typeof(bool?), typeof(CipherViewCell));
|
||||||
|
|
||||||
public static readonly BindableProperty ButtonCommandProperty = BindableProperty.Create(
|
public static readonly BindableProperty ButtonCommandProperty = BindableProperty.Create(
|
||||||
nameof(ButtonCommand), typeof(Command<CipherView>), typeof(CipherViewCell));
|
nameof(ButtonCommand), typeof(ICommand), typeof(CipherViewCell));
|
||||||
|
|
||||||
public CipherViewCell()
|
public CipherViewCell()
|
||||||
{
|
{
|
||||||
|
@ -42,9 +43,9 @@ namespace Bit.App.Controls
|
||||||
set => SetValue(CipherProperty, value);
|
set => SetValue(CipherProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Command<CipherView> ButtonCommand
|
public ICommand ButtonCommand
|
||||||
{
|
{
|
||||||
get => GetValue(ButtonCommandProperty) as Command<CipherView>;
|
get => GetValue(ButtonCommandProperty) as ICommand;
|
||||||
set => SetValue(ButtonCommandProperty, value);
|
set => SetValue(ButtonCommandProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,9 @@ namespace Bit.App.Pages
|
||||||
Refreshing = true;
|
Refreshing = true;
|
||||||
await LoadAsync();
|
await LoadAsync();
|
||||||
});
|
});
|
||||||
CipherOptionsCommand = new Command<CipherView>(CipherOptionsAsync);
|
CipherOptionsCommand = new AsyncCommand<CipherView>(cipher => AppHelpers.CipherListOptions(Page, cipher, _passwordRepromptService),
|
||||||
|
onException: ex => _logger.Exception(ex),
|
||||||
|
allowsMultipleExecutions: false);
|
||||||
VaultFilterCommand = new AsyncCommand(VaultFilterOptionsAsync,
|
VaultFilterCommand = new AsyncCommand(VaultFilterOptionsAsync,
|
||||||
onException: ex => _logger.Exception(ex),
|
onException: ex => _logger.Exception(ex),
|
||||||
allowsMultipleExecutions: false);
|
allowsMultipleExecutions: false);
|
||||||
|
@ -168,7 +170,7 @@ namespace Bit.App.Pages
|
||||||
public AccountSwitchingOverlayViewModel AccountSwitchingOverlayViewModel { get; }
|
public AccountSwitchingOverlayViewModel AccountSwitchingOverlayViewModel { get; }
|
||||||
public ObservableRangeCollection<IGroupingsPageListItem> GroupedItems { get; set; }
|
public ObservableRangeCollection<IGroupingsPageListItem> GroupedItems { get; set; }
|
||||||
public Command RefreshCommand { get; set; }
|
public Command RefreshCommand { get; set; }
|
||||||
public Command<CipherView> CipherOptionsCommand { get; set; }
|
public ICommand CipherOptionsCommand { get; }
|
||||||
public bool LoadedOnce { get; set; }
|
public bool LoadedOnce { get; set; }
|
||||||
|
|
||||||
public async Task LoadAsync()
|
public async Task LoadAsync()
|
||||||
|
@ -709,13 +711,5 @@ namespace Bit.App.Pages
|
||||||
var folders = decFolders.Where(f => _allCiphers.Any(c => c.FolderId == f.Id)).ToList();
|
var folders = decFolders.Where(f => _allCiphers.Any(c => c.FolderId == f.Id)).ToList();
|
||||||
return folders.Any() ? folders : null;
|
return folders.Any() ? folders : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void CipherOptionsAsync(CipherView cipher)
|
|
||||||
{
|
|
||||||
if ((Page as BaseContentPage).DoOnce())
|
|
||||||
{
|
|
||||||
await AppHelpers.CipherListOptions(Page, cipher, _passwordRepromptService);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue