diff --git a/Flow.Launcher/Storage/TopMostRecord.cs b/Flow.Launcher/Storage/TopMostRecord.cs index e76c57493..a2af6fe92 100644 --- a/Flow.Launcher/Storage/TopMostRecord.cs +++ b/Flow.Launcher/Storage/TopMostRecord.cs @@ -26,11 +26,25 @@ namespace Flow.Launcher.Storage internal void Remove(Result result) { + // origin query is null when user select the context menu item directly of one item from query list + // in this case, we do not need to remove the record + if (result.OriginQuery == null) + { + return; + } + records.Remove(result.OriginQuery.RawQuery, out _); } internal void AddOrUpdate(Result result) { + // origin query is null when user select the context menu item directly of one item from query list + // in this case, we do not need to add or update the record + if (result.OriginQuery == null) + { + return; + } + var record = new Record { PluginID = result.PluginID, @@ -39,11 +53,6 @@ namespace Flow.Launcher.Storage }; records.AddOrUpdate(result.OriginQuery.RawQuery, record, (key, oldValue) => record); } - - public void Load(Dictionary dictionary) - { - records = new ConcurrentDictionary(dictionary); - } } public class Record