Skip to content

Commit 764c674

Browse files
committed
code quality
1 parent f31abe8 commit 764c674

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Flow.Launcher/Helper/ResultHelper.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ public static class ResultHelper
4545

4646
public static bool IsEquals(this Result result, LastOpenedHistoryItem item, HistoryStyle style)
4747
{
48-
bool keyMatches = string.IsNullOrEmpty(result.RecordKey)
49-
? item.Title == result.Title
50-
: item.RecordKey == result.RecordKey;
48+
bool keyMatches = string.IsNullOrEmpty(result.RecordKey) && string.IsNullOrEmpty(item.RecordKey)
49+
? item.Title == result.Title
50+
: !string.IsNullOrEmpty(result.RecordKey) && !string.IsNullOrEmpty(item.RecordKey) && item.RecordKey == result.RecordKey;
51+
52+
bool queryMatches = style != HistoryStyle.Query || (result.OriginQuery != null && item.Query == result.OriginQuery.RawQuery);
5153

52-
bool queryMatches = style != HistoryStyle.Query || item.Query == result.OriginQuery.RawQuery;
5354

5455
return keyMatches
5556
&& queryMatches

0 commit comments

Comments
 (0)