@@ -33,6 +33,7 @@ public partial class MainViewModel : BaseModel, ISavable, IDisposable
3333
3434 private bool _isQueryRunning ;
3535 private Query _lastQuery ;
36+ private bool _lastHomeQuery ;
3637 private string _queryTextBeforeLeaveResults ;
3738 private string _ignoredQueryText = null ;
3839
@@ -1261,6 +1262,8 @@ private async Task QueryResultsAsync(bool searchDelay, bool isReQuery = false, b
12611262 return ;
12621263 }
12631264
1265+ var homeQuery = query . RawQuery == string . Empty ;
1266+
12641267 _updateSource = new CancellationTokenSource ( ) ;
12651268
12661269 ProgressBarVisibility = Visibility . Hidden ;
@@ -1275,11 +1278,11 @@ private async Task QueryResultsAsync(bool searchDelay, bool isReQuery = false, b
12751278 query . IsReQuery = isReQuery ;
12761279
12771280 // handle the exclusiveness of plugin using action keyword
1278- RemoveOldQueryResults ( query ) ;
1281+ RemoveOldQueryResults ( query , homeQuery ) ;
12791282
12801283 _lastQuery = query ;
1284+ _lastHomeQuery = homeQuery ;
12811285
1282- var homeQuery = query . RawQuery == string . Empty ;
12831286 ICollection < PluginPair > plugins = Array . Empty < PluginPair > ( ) ;
12841287 if ( homeQuery )
12851288 {
@@ -1524,9 +1527,15 @@ private async Task BuildQueryAsync(IEnumerable<BaseBuiltinShortcutModel> builtIn
15241527 }
15251528 }
15261529
1527- private void RemoveOldQueryResults ( Query query )
1530+ private void RemoveOldQueryResults ( Query query , bool homeQuery )
15281531 {
1529- if ( _lastQuery ? . ActionKeyword != query ? . ActionKeyword )
1532+ // If last or current query is home query, we need to clear the results
1533+ if ( _lastHomeQuery || homeQuery )
1534+ {
1535+ Results . Clear ( ) ;
1536+ }
1537+ // If last and current query are not home query, we need to check action keyword
1538+ else if ( _lastQuery ? . ActionKeyword != query ? . ActionKeyword )
15301539 {
15311540 Results . Clear ( ) ;
15321541 }
0 commit comments