Skip to content

Commit 2b4f777

Browse files
committed
Clear possible home page results
1 parent 0e74643 commit 2b4f777

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,7 @@ public async Task SetupQuickSwitchAsync(nint handle)
18131813
(Application.Current?.MainWindow as MainWindow).UpdatePosition();
18141814
});
18151815

1816-
_ = ResetWindowAsync();
1816+
_ = ResetWindowAsync(true);
18171817
}
18181818
}
18191819
else
@@ -1824,14 +1824,14 @@ public async Task SetupQuickSwitchAsync(nint handle)
18241824

18251825
if (dialogWindowHandleChanged)
18261826
{
1827-
_ = ResetWindowAsync();
1827+
_ = ResetWindowAsync(true);
18281828
}
18291829
}
18301830
else
18311831
{
18321832
if (dialogWindowHandleChanged)
18331833
{
1834-
_ = ResetWindowAsync();
1834+
_ = ResetWindowAsync(true);
18351835
}
18361836
}
18371837
}
@@ -1933,7 +1933,7 @@ public void HideQuickSwitch()
19331933
}
19341934

19351935
// Reset index & preview & selected results & query text
1936-
private async Task ResetWindowAsync()
1936+
private async Task ResetWindowAsync(bool clearResults = false)
19371937
{
19381938
lastHistoryIndex = 1;
19391939

@@ -1948,6 +1948,11 @@ private async Task ResetWindowAsync()
19481948
}
19491949

19501950
await ChangeQueryTextAsync(string.Empty);
1951+
1952+
if (clearResults)
1953+
{
1954+
ClearResults();
1955+
}
19511956
}
19521957

19531958
#endregion

0 commit comments

Comments
 (0)