Skip to content

Commit d30e793

Browse files
authored
Merge pull request #352 from Flow-Launcher/fixUpdateSettingRemove
don't remove setting when updating
2 parents dec9941 + 4fdcdcd commit d30e793

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ where existingPlugin.Metadata.Version.CompareTo(pluginFromManifest.Version) <
233233
Context.API.GetTranslation("plugin_pluginsmanager_update_title"),
234234
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
235235
{
236-
Uninstall(x.PluginExistingMetadata);
236+
Uninstall(x.PluginExistingMetadata, false);
237237

238238
var downloadToFilePath = Path.Combine(DataLocation.PluginsDirectory,
239239
$"{x.Name}-{x.NewVersion}.zip");
@@ -414,10 +414,13 @@ internal List<Result> RequestUninstall(string search)
414414
return Search(results, uninstallSearch);
415415
}
416416

417-
private void Uninstall(PluginMetadata plugin)
417+
private void Uninstall(PluginMetadata plugin, bool removedSetting = true)
418418
{
419-
PluginManager.Settings.Plugins.Remove(plugin.ID);
420-
PluginManager.AllPlugins.RemoveAll(p => p.Metadata.ID == plugin.ID);
419+
if (removedSetting)
420+
{
421+
PluginManager.Settings.Plugins.Remove(plugin.ID);
422+
PluginManager.AllPlugins.RemoveAll(p => p.Metadata.ID == plugin.ID);
423+
}
421424

422425
// Marked for deletion. Will be deleted on next start up
423426
using var _ = File.CreateText(Path.Combine(plugin.PluginDirectory, "NeedDelete.txt"));

Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"Name": "Plugins Manager",
77
"Description": "Management of installing, uninstalling or updating Flow Launcher plugins",
88
"Author": "Jeremy Wu",
9-
"Version": "1.7.0",
9+
"Version": "1.7.1",
1010
"Language": "csharp",
1111
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
1212
"ExecuteFileName": "Flow.Launcher.Plugin.PluginsManager.dll",

0 commit comments

Comments
 (0)