@@ -33,6 +33,7 @@ public partial class MainViewModel : BaseModel, ISavable, IDisposable
33
33
34
34
private bool _isQueryRunning ;
35
35
private Query _lastQuery ;
36
+ private bool _lastHomeQuery ;
36
37
private string _queryTextBeforeLeaveResults ;
37
38
private string _ignoredQueryText = null ;
38
39
@@ -1261,6 +1262,8 @@ private async Task QueryResultsAsync(bool searchDelay, bool isReQuery = false, b
1261
1262
return ;
1262
1263
}
1263
1264
1265
+ var homeQuery = query . RawQuery == string . Empty ;
1266
+
1264
1267
_updateSource = new CancellationTokenSource ( ) ;
1265
1268
1266
1269
ProgressBarVisibility = Visibility . Hidden ;
@@ -1275,11 +1278,11 @@ private async Task QueryResultsAsync(bool searchDelay, bool isReQuery = false, b
1275
1278
query . IsReQuery = isReQuery ;
1276
1279
1277
1280
// handle the exclusiveness of plugin using action keyword
1278
- RemoveOldQueryResults ( query ) ;
1281
+ RemoveOldQueryResults ( query , homeQuery ) ;
1279
1282
1280
1283
_lastQuery = query ;
1284
+ _lastHomeQuery = homeQuery ;
1281
1285
1282
- var homeQuery = query . RawQuery == string . Empty ;
1283
1286
ICollection < PluginPair > plugins = Array . Empty < PluginPair > ( ) ;
1284
1287
if ( homeQuery )
1285
1288
{
@@ -1524,9 +1527,15 @@ private async Task BuildQueryAsync(IEnumerable<BaseBuiltinShortcutModel> builtIn
1524
1527
}
1525
1528
}
1526
1529
1527
- private void RemoveOldQueryResults ( Query query )
1530
+ private void RemoveOldQueryResults ( Query query , bool homeQuery )
1528
1531
{
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 )
1530
1539
{
1531
1540
Results . Clear ( ) ;
1532
1541
}
0 commit comments