From 903aec57c1c891ada519f8b4582889a84aec6ee8 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Tue, 8 Nov 2022 12:27:03 +0800 Subject: [PATCH 1/2] bugfix --- Flow.Launcher/ViewModel/MainViewModel.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 9b373d641..054347f4f 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -633,6 +633,8 @@ namespace Flow.Launcher.ViewModel var query = ConstructQuery(QueryText, Settings.CustomShortcuts, Settings.BuiltinShortcuts); + if (query == null) // shortcut expanded + return; _updateSource?.Dispose(); From 5a0e432cc299b1034b8427b62a1cb16ed59785ec Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Tue, 8 Nov 2022 12:35:28 +0800 Subject: [PATCH 2/2] Fix issue when clipboard is empty --- Flow.Launcher/ViewModel/MainViewModel.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 054347f4f..7c4eb92b8 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -622,7 +622,9 @@ namespace Flow.Launcher.ViewModel { _updateSource?.Cancel(); - if (string.IsNullOrWhiteSpace(QueryText)) + var query = ConstructQuery(QueryText, Settings.CustomShortcuts, Settings.BuiltinShortcuts); + + if (query == null) // shortcut expanded { Results.Clear(); Results.Visbility = Visibility.Collapsed; @@ -631,11 +633,6 @@ namespace Flow.Launcher.ViewModel return; } - var query = ConstructQuery(QueryText, Settings.CustomShortcuts, Settings.BuiltinShortcuts); - - if (query == null) // shortcut expanded - return; - _updateSource?.Dispose(); var currentUpdateSource = new CancellationTokenSource(); @@ -743,6 +740,11 @@ namespace Flow.Launcher.ViewModel private Query ConstructQuery(string queryText, IEnumerable customShortcuts, IEnumerable builtInShortcuts) { + if (string.IsNullOrWhiteSpace(queryText)) + { + return null; + } + StringBuilder queryBuilder = new(queryText); StringBuilder queryBuilderTmp = new(queryText);