mirror of
https://github.com/bitwarden/mobile
synced 2025-12-13 14:53:18 +00: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:
@@ -75,7 +75,7 @@ namespace Bit.App.Pages
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_vm.Search(e.NewTextValue, 500);
|
_vm.Search(e.NewTextValue, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SearchBar_SearchButtonPressed(object sender, EventArgs e)
|
private void SearchBar_SearchButtonPressed(object sender, EventArgs e)
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ namespace Bit.App.Pages
|
|||||||
.GetValueOrDefault();
|
.GetValueOrDefault();
|
||||||
if(!string.IsNullOrWhiteSpace((Page as CiphersPage).SearchBar.Text))
|
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)
|
catch(OperationCanceledException)
|
||||||
{
|
{
|
||||||
ciphers = new List<CipherView>();
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(ciphers == null)
|
if(ciphers == null)
|
||||||
{
|
{
|
||||||
ciphers = new List<CipherView>();
|
ciphers = new List<CipherView>();
|
||||||
}
|
}
|
||||||
Ciphers.ResetWithRange(ciphers);
|
Device.BeginInvokeOnMainThread(() =>
|
||||||
ShowNoData = searchable && Ciphers.Count == 0;
|
{
|
||||||
ShowList = searchable && !ShowNoData;
|
Ciphers.ResetWithRange(ciphers);
|
||||||
|
ShowNoData = searchable && Ciphers.Count == 0;
|
||||||
|
ShowList = searchable && !ShowNoData;
|
||||||
|
});
|
||||||
}, cts.Token);
|
}, cts.Token);
|
||||||
_searchCancellationTokenSource = cts;
|
_searchCancellationTokenSource = cts;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user