Skip to content

Commit 5d67019

Browse files
committed
Add delay
1 parent a4d929b commit 5d67019

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Flow.Launcher/Helper/HotKeyMapper.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
using Flow.Launcher.Core.Resource;
77
using System.Windows;
88
using Flow.Launcher.ViewModel;
9+
using System.Threading.Tasks;
10+
using System.Threading;
911

1012
namespace Flow.Launcher.Helper
1113
{
@@ -58,8 +60,10 @@ internal static void OnHotkey(object sender, HotkeyEventArgs e)
5860
if (!ShouldIgnoreHotkeys())
5961
{
6062
UpdateLastQUeryMode();
61-
62-
mainViewModel.ToggleFlowLauncher();
63+
64+
var overlayTask = Task.Delay(20).ContinueWith(_ => {
65+
mainViewModel.ToggleFlowLauncher();
66+
}, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());
6367
e.Handled = true;
6468
}
6569
}
@@ -77,7 +81,7 @@ private static void UpdateLastQUeryMode()
7781
switch(settings.LastQueryMode)
7882
{
7983
case LastQueryMode.Empty:
80-
mainViewModel.ChangeQueryText(string.Empty);
84+
mainViewModel.ChangeQueryText("");
8185
break;
8286
case LastQueryMode.Preserved:
8387
mainViewModel.LastQuerySelected = true;

0 commit comments

Comments
 (0)