diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs index 67148984624..c1ed904b337 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs @@ -534,7 +534,7 @@ internal List InstallFromWeb(string url) return false; } - Application.Current.MainWindow.Hide(); + Context.API.HideMainWindow(); _ = InstallOrUpdateAsync(plugin); return ShouldHideWindow; @@ -572,7 +572,7 @@ internal List InstallFromLocalPath(string localPath) return false; } - Application.Current.MainWindow.Hide(); + Context.API.HideMainWindow(); _ = InstallOrUpdateAsync(plugin); return ShouldHideWindow; @@ -626,7 +626,7 @@ internal async ValueTask> RequestInstallOrUpdateAsync(string search return ShouldHideWindow; } - Application.Current.MainWindow.Hide(); + Context.API.HideMainWindow(); _ = InstallOrUpdateAsync(x); // No need to wait return ShouldHideWindow; }, @@ -703,7 +703,7 @@ internal List RequestUninstall(string search) Context.API.GetTranslation("plugin_pluginsmanager_uninstall_title"), MessageBoxButton.YesNo) == MessageBoxResult.Yes) { - Application.Current.MainWindow.Hide(); + Context.API.HideMainWindow(); Uninstall(x.Metadata); if (Settings.AutoRestartAfterChanging) { diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs index 5bfc68ea613..edf9c82e47a 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs @@ -333,7 +333,7 @@ private List Commands() Action = c => { // Hide the window first then show msg after done because sometimes the reload could take a while, so not to make user think it's frozen. - Application.Current.MainWindow.Hide(); + context.API.HideMainWindow(); _ = context.API.ReloadAllPluginData().ContinueWith(_ => context.API.ShowMsg( @@ -352,7 +352,7 @@ private List Commands() IcoPath = "Images\\checkupdate.png", Action = c => { - Application.Current.MainWindow.Hide(); + context.API.HideMainWindow(); context.API.CheckForNewUpdate(); return true; }