Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions Flow.Launcher/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
using Flow.Launcher.Plugin;
using Flow.Launcher.Plugin.SharedCommands;
using Flow.Launcher.Storage;
using iNKORE.UI.WPF.Modern;

Check warning on line 28 in Flow.Launcher/ViewModel/MainViewModel.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`NKORE` is not a recognized word (unrecognized-spelling)

Check warning on line 28 in Flow.Launcher/ViewModel/MainViewModel.cs

View workflow job for this annotation

GitHub Actions / Report (PR)

`NKORE` is not a recognized word (unrecognized-spelling)
using Microsoft.VisualStudio.Threading;

namespace Flow.Launcher.ViewModel
Expand Down Expand Up @@ -273,7 +273,7 @@
#if DEBUG
throw t.Exception;
#else
App.API.LogError(ClassName, $"Error happen in task dealing with viewupdate for results. {t.Exception}");

Check warning on line 276 in Flow.Launcher/ViewModel/MainViewModel.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`viewupdate` is not a recognized word (unrecognized-spelling)

Check warning on line 276 in Flow.Launcher/ViewModel/MainViewModel.cs

View workflow job for this annotation

GitHub Actions / Report (PR)

`viewupdate` is not a recognized word (unrecognized-spelling)
_resultsViewUpdateTask =
Task.Run(UpdateActionAsync).ContinueWith(continueAction, CancellationToken.None, TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default);
#endif
Expand Down Expand Up @@ -479,7 +479,7 @@
else if (!string.IsNullOrEmpty(SelectedResults.SelectedItem?.QuerySuggestionText))
{
//var defaultSuggestion = SelectedResults.SelectedItem.QuerySuggestionText;
//// check if result.actionkeywordassigned is empty

Check warning on line 482 in Flow.Launcher/ViewModel/MainViewModel.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`actionkeywordassigned` is not a recognized word (unrecognized-spelling)

Check warning on line 482 in Flow.Launcher/ViewModel/MainViewModel.cs

View workflow job for this annotation

GitHub Actions / Report (PR)

`actionkeywordassigned` is not a recognized word (unrecognized-spelling)
//if (!string.IsNullOrEmpty(result.ActionKeywordAssigned))
//{
// autoCompleteText = $"{result.ActionKeywordAssigned} {defaultSuggestion}";
Expand Down Expand Up @@ -515,6 +515,17 @@
return;
}

// New history result must be recorded before ExecuteAsync and Hide() is called, otherwise when in 'Empty Last Query' query style mode
// the QueryAsync call will reconstruct the result list without the new item.
// This must happen before ExecuteAsync because some plugin actions call HideMainWindow() inside their action,
// which triggers a home query that reads history before _history.Add would have been called.
// Also, add item to history only if it is from results but not context menu or history.
if (queryResultsSelected)
{
_history.Add(result);
lastHistoryIndex = 1;
}

var hideWindow = false;
var isDialogJumpLeftClick = _isDialogJump && Settings.DialogJumpResultBehaviour == DialogJumpResultBehaviours.LeftClick;

Expand All @@ -541,15 +552,6 @@
}).ConfigureAwait(false);
}

// New history result must be recorded before Hide() is called, otherwise when in 'Empty Last Query' query style mode
// the QueryAsync call will reconstruct the result list without the new item.
// Also, add item to history only if it is from results but not context menu or history.
if (queryResultsSelected)
{
_history.Add(result);
lastHistoryIndex = 1;
}

// Only hide for query results (not Dialog Jump left-click mode)
if (!isDialogJumpLeftClick && hideWindow)
{
Expand Down
Loading