Fix dialog jump issue when result will not be execueted under empty query option

This commit is contained in:
Jack251970 2025-07-23 17:33:03 +08:00
parent 1da7e1ef35
commit 20f6a74fbe

View file

@ -501,15 +501,14 @@ namespace Flow.Launcher.ViewModel
// For Dialog Jump and left click mode, we need to navigate to the path
if (_isDialogJump && Settings.DialogJumpResultBehaviour == DialogJumpResultBehaviours.LeftClick)
{
Hide();
if (SelectedResults.SelectedItem != null && DialogWindowHandle != nint.Zero)
if (result is DialogJumpResult dialogJumpResult)
{
if (result is DialogJumpResult dialogJumpResult)
{
Win32Helper.SetForegroundWindow(DialogWindowHandle);
_ = Task.Run(() => DialogJump.JumpToPathAsync(DialogWindowHandle, dialogJumpResult.DialogJumpPath));
}
Win32Helper.SetForegroundWindow(DialogWindowHandle);
_ = Task.Run(() => DialogJump.JumpToPathAsync(DialogWindowHandle, dialogJumpResult.DialogJumpPath));
}
else
{
App.API.LogError(ClassName, "DialogJumpResult expected but got a different result type.");
}
}
// For query mode, we execute the result