Check action keywords without order

This commit is contained in:
Jack251970 2025-02-23 19:42:43 +08:00
parent 34cb078602
commit 4ebc19a82d

View file

@ -418,11 +418,15 @@ namespace Flow.Launcher.Core.Plugin
}
}
private static bool CheckActionKeywordChanged(IReadOnlyList<string> oldActionKeyword, IReadOnlyList<string> newActionKeyword)
private static bool CheckActionKeywordChanged(IReadOnlyList<string> oldActionKeywords, IReadOnlyList<string> newActionKeywords)
{
if (oldActionKeyword.Count != newActionKeyword.Count)
if (oldActionKeywords.Count != newActionKeywords.Count)
return true;
return oldActionKeyword.Where((t, i) => t != newActionKeyword[i]).Any();
var sortedOldActionKeywords = oldActionKeywords.OrderBy(s => s).ToList();
var sortedNewActionKeywords = newActionKeywords.OrderBy(s => s).ToList();
return !sortedOldActionKeywords.SequenceEqual(sortedNewActionKeywords);
}
public static void ReplaceActionKeyword(string id, string oldActionKeyword, string newActionKeyword)