mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-25 12:05:59 +01:00
Fixed issue where multiple threads were attempting to modify search result list (#761)
* Fixed issue where multiple threads were attempting to modify search result list * Fixed race condition
This commit is contained in:
parent
6263788d6a
commit
8a059e0fbb
@ -75,7 +75,7 @@ namespace Bit.App.Pages
|
||||
{
|
||||
return;
|
||||
}
|
||||
_vm.Search(e.NewTextValue, 500);
|
||||
_vm.Search(e.NewTextValue, 200);
|
||||
}
|
||||
|
||||
private void SearchBar_SearchButtonPressed(object sender, EventArgs e)
|
||||
|
@ -77,7 +77,7 @@ namespace Bit.App.Pages
|
||||
.GetValueOrDefault();
|
||||
if(!string.IsNullOrWhiteSpace((Page as CiphersPage).SearchBar.Text))
|
||||
{
|
||||
Search((Page as CiphersPage).SearchBar.Text, 500);
|
||||
Search((Page as CiphersPage).SearchBar.Text, 200);
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,16 +110,19 @@ namespace Bit.App.Pages
|
||||
}
|
||||
catch(OperationCanceledException)
|
||||
{
|
||||
ciphers = new List<CipherView>();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(ciphers == null)
|
||||
{
|
||||
ciphers = new List<CipherView>();
|
||||
}
|
||||
Ciphers.ResetWithRange(ciphers);
|
||||
ShowNoData = searchable && Ciphers.Count == 0;
|
||||
ShowList = searchable && !ShowNoData;
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
Ciphers.ResetWithRange(ciphers);
|
||||
ShowNoData = searchable && Ciphers.Count == 0;
|
||||
ShowList = searchable && !ShowNoData;
|
||||
});
|
||||
}, cts.Token);
|
||||
_searchCancellationTokenSource = cts;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user