Skip to content

Commit 6318bbe

Browse files
committed
Fix an issue that pm install/uninstall same plugin without restart says correct message but another message also pops up to say it's successfully installed
1 parent 01e749a commit 6318bbe

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Flow.Launcher.Core/Plugin/PluginInstaller.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ public static class PluginInstaller
2727

2828
public static async Task InstallPluginAndCheckRestartAsync(UserPlugin newPlugin)
2929
{
30+
if (API.PluginModified(newPlugin.ID))
31+
{
32+
API.ShowMsg(string.Format(API.GetTranslation("failedToInstallPluginTitle"), newPlugin.Name),
33+
API.GetTranslation("pluginModifiedAlreadyMessage"));
34+
return;
35+
}
36+
3037
if (API.ShowMsgBox(
3138
string.Format(
3239
API.GetTranslation("InstallPromptSubtitle"),
@@ -117,6 +124,13 @@ public static async Task InstallPluginAndCheckRestartAsync(string filePath)
117124
return;
118125
}
119126

127+
if (API.PluginModified(plugin.ID))
128+
{
129+
API.ShowMsg(string.Format(API.GetTranslation("failedToInstallPluginTitle"), plugin.Name),
130+
API.GetTranslation("pluginModifiedAlreadyMessage"));
131+
return;
132+
}
133+
120134
if (Settings.ShowUnknownSourceWarning)
121135
{
122136
if (!InstallSourceKnown(plugin.Website)
@@ -132,6 +146,13 @@ public static async Task InstallPluginAndCheckRestartAsync(string filePath)
132146

133147
public static async Task UninstallPluginAndCheckRestartAsync(PluginMetadata oldPlugin)
134148
{
149+
if (API.PluginModified(oldPlugin.ID))
150+
{
151+
API.ShowMsg(string.Format(API.GetTranslation("failedToUninstallPluginTitle"), oldPlugin.Name),
152+
API.GetTranslation("pluginModifiedAlreadyMessage"));
153+
return;
154+
}
155+
135156
if (API.ShowMsgBox(
136157
string.Format(
137158
API.GetTranslation("UninstallPromptSubtitle"),

0 commit comments

Comments
 (0)