PS-291 Fix password history to update the collection on the main thread to load correctly (#1890)

This commit is contained in:
Federico Maccaroni 2022-04-25 18:43:55 -03:00 committed by GitHub
parent 2cab62fda5
commit 57213607a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,8 +41,11 @@ namespace Bit.App.Pages
public async Task InitAsync() public async Task InitAsync()
{ {
var history = await _passwordGenerationService.GetHistoryAsync(); var history = await _passwordGenerationService.GetHistoryAsync();
Device.BeginInvokeOnMainThread(() =>
{
History.ResetWithRange(history ?? new List<GeneratedPasswordHistory>()); History.ResetWithRange(history ?? new List<GeneratedPasswordHistory>());
ShowNoData = History.Count == 0; ShowNoData = History.Count == 0;
});
} }
public async Task ClearAsync() public async Task ClearAsync()