Remove unnecessary view model reference

This commit is contained in:
VictoriousRaptor 2025-07-18 00:15:46 +08:00
parent 2018956034
commit 7ca0dba461
2 changed files with 4 additions and 8 deletions

View file

@ -21,13 +21,10 @@ namespace Flow.Launcher.Plugin.Explorer
private Settings Settings { get; set; }
private SettingsViewModel ViewModel { get; set; }
public ContextMenu(PluginInitContext context, Settings settings, SettingsViewModel vm)
public ContextMenu(PluginInitContext context, Settings settings)
{
Context = context;
Settings = settings;
ViewModel = vm;
}
public List<Result> LoadContextMenus(Result selectedResult)
@ -84,7 +81,7 @@ namespace Flow.Launcher.Plugin.Explorer
Context.API.GetTranslation("plugin_explorer_addfilefoldersuccess_detail"),
Constants.ExplorerIconImageFullPath);
ViewModel.Save();
Context.API.SaveSettingJsonStorage<Settings>();
return true;
},
@ -108,7 +105,7 @@ namespace Flow.Launcher.Plugin.Explorer
Context.API.GetTranslation("plugin_explorer_removefilefoldersuccess_detail"),
Constants.ExplorerIconImageFullPath);
ViewModel.Save();
Context.API.SaveSettingJsonStorage<Settings>();
return true;
},

View file

@ -38,8 +38,7 @@ namespace Flow.Launcher.Plugin.Explorer
FillQuickAccessLinkNames();
viewModel = new SettingsViewModel(context, Settings);
contextMenu = new ContextMenu(Context, Settings, viewModel);
contextMenu = new ContextMenu(Context, Settings);
searchManager = new SearchManager(Settings, Context);
ResultManager.Init(Context, Settings);