mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Wait 50 ms for query staying same when updating view.
This commit is contained in:
parent
ea5e9a0fae
commit
4fb884cf57
1 changed files with 8 additions and 1 deletions
|
|
@ -229,6 +229,7 @@ namespace Flow.Launcher.ViewModel
|
|||
public ResultsViewModel Results { get; private set; }
|
||||
public ResultsViewModel ContextMenu { get; private set; }
|
||||
public ResultsViewModel History { get; private set; }
|
||||
private string _lastQueryText;
|
||||
|
||||
private string _queryText;
|
||||
public string QueryText
|
||||
|
|
@ -427,8 +428,14 @@ namespace Flow.Launcher.ViewModel
|
|||
}, currentCancellationToken);
|
||||
|
||||
var plugins = PluginManager.ValidPluginsForQuery(query);
|
||||
Task.Run(() =>
|
||||
Task.Run(async () =>
|
||||
{
|
||||
// Wait 50 millisecond for query change
|
||||
// if query stay the same, update the view
|
||||
await Task.Delay(50);
|
||||
if (!(_lastQuery.RawQuery == QueryText))
|
||||
return;
|
||||
|
||||
// so looping will stop once it was cancelled
|
||||
var parallelOptions = new ParallelOptions { CancellationToken = currentCancellationToken };
|
||||
try
|
||||
|
|
|
|||
Loading…
Reference in a new issue