Skip to content

Commit 445ca9a

Browse files
committed
Do not pass token to make sure it is handled
1 parent 3ee52d7 commit 445ca9a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,8 +1438,9 @@ await PluginManager.QueryHomeForPluginAsync(plugin, query, token) :
14381438
_lastQuery = query;
14391439
_previousIsHomeQuery = currentIsHomeQuery;
14401440

1441+
// If this update task is for clearing existing results, do not pass token to make sure it is handled
14411442
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(resultsCopy, plugin.Metadata, query,
1442-
token, reSelect, shouldClearExistingResults)))
1443+
shouldClearExistingResults ? default : token, reSelect, shouldClearExistingResults)))
14431444
{
14441445
App.API.LogError(ClassName, "Unable to add item to Result Update Queue");
14451446
}
@@ -1461,8 +1462,9 @@ void QueryHistoryTask(CancellationToken token)
14611462
_lastQuery = query;
14621463
_previousIsHomeQuery = currentIsHomeQuery;
14631464

1465+
// If this update task is for clearing existing results, do not pass token to make sure it is handled
14641466
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(results, _historyMetadata, query,
1465-
token, reSelect, shouldClearExistingResults)))
1467+
shouldClearExistingResults ? default : token, reSelect, shouldClearExistingResults)))
14661468
{
14671469
App.API.LogError(ClassName, "Unable to add item to Result Update Queue");
14681470
}

0 commit comments

Comments
 (0)