is equals

This commit is contained in:
01Dri 2025-10-14 22:49:03 -03:00
parent 0131b92c7a
commit ced824d791

View file

@ -2,6 +2,7 @@
using System.Threading;
using System.Threading.Tasks;
using Flow.Launcher.Core.Plugin;
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin;
using Flow.Launcher.Storage;
@ -41,4 +42,18 @@ public static class ResultHelper
return null;
}
}
public static bool IsEquals(this Result result, LastOpenedHistoryItem item, HistoryStyle style)
{
bool keyMatches = string.IsNullOrEmpty(result.RecordKey)
? item.Title == result.Title
: item.RecordKey == result.RecordKey;
bool queryMatches = style != HistoryStyle.Query || item.Query == result.OriginQuery.RawQuery;
return keyMatches
&& queryMatches
&& item.PluginID == result.PluginID
&& item.HistoryStyle == style;
}
}