replace action keyword when updating

This commit is contained in:
Jeremy 2021-05-29 22:00:10 +10:00
parent 7e799b5625
commit e5fbfa24b4
3 changed files with 3 additions and 6 deletions

View file

@ -274,7 +274,7 @@ namespace Flow.Launcher.Core.Plugin
}
/// <summary>
/// used to add action keyword for multiple action keyword plugin
/// used to remove action keyword for multiple action keyword plugin
/// e.g. web search
/// </summary>
public static void RemoveActionKeyword(string id, string oldActionkeyword)

View file

@ -43,10 +43,7 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels
internal void UpdateActionKeyword(ActionKeywordProperty modifiedActionKeyword, string newActionKeyword, string oldActionKeyword)
{
if (Settings.SearchActionKeyword == Settings.PathSearchActionKeyword)
PluginManager.AddActionKeyword(Context.CurrentPluginMetadata.ID, newActionKeyword);
else
PluginManager.ReplaceActionKeyword(Context.CurrentPluginMetadata.ID, oldActionKeyword, newActionKeyword);
PluginManager.ReplaceActionKeyword(Context.CurrentPluginMetadata.ID, oldActionKeyword, newActionKeyword);
switch (modifiedActionKeyword)
{

View file

@ -34,7 +34,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
this.actionKeywordListView = actionKeywordListView;
// Search and File Content action keyword are not allowed to be disabled, they are the default search keyword.
// Search and File Content action keyword are not allowed to be disabled, they are the default search keywords.
if (currentActionKeyword.KeywordProperty == ActionKeywordProperty.SearchActionKeyword
|| currentActionKeyword.KeywordProperty == ActionKeywordProperty.FileContentSearchActionKeyword)
chkActionKeywordEnabled.Visibility = Visibility.Collapsed;