From b13c29ab91aee6f2a8674ee232811fa425bf2ded Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Wed, 15 Oct 2025 12:40:00 +0800 Subject: [PATCH] Record user selection after successful execution --- Flow.Launcher/ViewModel/MainViewModel.cs | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index d0c59a7f2..706be8bb8 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -1358,25 +1358,12 @@ namespace Flow.Launcher.ViewModel var reflectResult = await ResultHelper.PopulateResultsAsync(h); if (reflectResult != null) { - if (reflectResult.Action != null) - { - // Record the user selected record for result ranking - _userSelectedRecord.Add(reflectResult); + // Record the user selected record for result ranking + _userSelectedRecord.Add(reflectResult); - // Since some actions may need to hide the Flow window to execute - // So let us populate the results of them - return reflectResult.Action(c); - } - if (reflectResult.AsyncAction != null) - { - // Record the user selected record for result ranking - _userSelectedRecord.Add(reflectResult); - - // Since some actions may need to hide the Flow window to execute - // So let us populate the results of them - return await reflectResult.AsyncAction(c); - } - return false; + // Since some actions may need to hide the Flow window to execute + // So let us populate the results of them + return await reflectResult.ExecuteAsync(c); } // If we cannot get the result, fallback to re-query