Skip to content

Commit c06e6d1

Browse files
committed
Check modified state when updating plugins
1 parent ae206c3 commit c06e6d1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,10 +549,19 @@ public static bool PluginModified(string id)
549549

550550
public static async Task<bool> UpdatePluginAsync(PluginMetadata existingVersion, UserPlugin newVersion, string zipFilePath)
551551
{
552+
if (PluginModified(existingVersion.ID))
553+
{
554+
API.ShowMsgError(string.Format(API.GetTranslation("pluginModifiedAlreadyTitle"), existingVersion.Name),
555+
API.GetTranslation("pluginModifiedAlreadyMessage"));
556+
return false;
557+
}
558+
552559
var installSuccess = InstallPlugin(newVersion, zipFilePath, checkModified:false);
553560
if (!installSuccess) return false;
561+
554562
var uninstallSuccess = await UninstallPluginAsync(existingVersion, removePluginFromSettings:false, removePluginSettings:false, checkModified: false);
555563
if (!uninstallSuccess) return false;
564+
556565
_modifiedPlugins.Add(existingVersion.ID);
557566
return true;
558567
}

0 commit comments

Comments
 (0)