Skip to content

Commit 9ab845f

Browse files
committed
Fix rebase 2
1 parent 9f4b474 commit 9ab845f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/Files.App/ViewModels/UserControls/NavigationToolbarViewModel.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,19 +1279,20 @@ await Task.Run(() =>
12791279

12801280
public async Task PopulateOmnibarSuggestionsForSearchMode()
12811281
{
1282-
OmnibarSearchModeSuggestionItems.Clear();
1283-
12841282
if (ContentPageContext.ShellPage is null)
12851283
return;
12861284

1287-
ContentPageContext.ShellPage.ShellViewModel.FilesAndFoldersFilter = OmnibarSearchModeText;
1288-
1289-
// Refresh the browser to apply the search filter
1290-
await ContentPageContext.ShellPage.ShellViewModel.ApplyFilesAndFoldersChangesAsync();
1285+
List<SuggestionModel> newSuggestions = [];
12911286

1292-
if (!string.IsNullOrWhiteSpace(OmnibarSearchModeText))
1287+
if (string.IsNullOrWhiteSpace(OmnibarSearchModeText))
1288+
{
1289+
var previousSearchQueries = UserSettingsService.GeneralSettingsService.PreviousSearchQueriesList;
1290+
if (previousSearchQueries is not null)
1291+
newSuggestions.AddRange(previousSearchQueries.Select(query => new SuggestionModel(query, true)));
1292+
}
1293+
else
12931294
{
1294-
var search = new FolderSearch()
1295+
var search = new FolderSearch
12951296
{
12961297
Query = OmnibarSearchModeText,
12971298
Folder = ContentPageContext.ShellPage.ShellViewModel.WorkingDirectory,

0 commit comments

Comments
 (0)