Update labels on first get

This commit is contained in:
VictoriousRaptor 2025-07-18 21:07:53 +08:00
parent 7ca0dba461
commit 976c30e0d2
2 changed files with 13 additions and 4 deletions

View file

@ -35,7 +35,6 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels
InitializeEngineSelection();
InitializeActionKeywordModels();
EverythingSortOptionLocalized.UpdateLabels(AllEverythingSortOptions);
}
public void Save()
@ -579,7 +578,19 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels
#region Everything FastSortWarning
public List<EverythingSortOptionLocalized> AllEverythingSortOptions { get; } = EverythingSortOptionLocalized.GetValues();
private List<EverythingSortOptionLocalized> _allEverythingSortOptions = new();
public List<EverythingSortOptionLocalized> AllEverythingSortOptions
{
get
{
if (_allEverythingSortOptions.Count == 0)
{
_allEverythingSortOptions = EverythingSortOptionLocalized.GetValues();
EverythingSortOptionLocalized.UpdateLabels(_allEverythingSortOptions);
}
return _allEverythingSortOptions;
}
}
public EverythingSortOption SelectedEverythingSortOption
{

View file

@ -39,8 +39,6 @@ namespace Flow.Launcher.Plugin.Explorer.Views
ExcludedPathsExpander
};
// Update labels because the view model is initialized in InitAsync
Search.Everything.EverythingSortOptionLocalized.UpdateLabels(_viewModel.AllEverythingSortOptions);
}
private void AccessLinkDragDrop(string containerName, DragEventArgs e)