diff --git a/Flow.Launcher/Storage/QueryHistory.cs b/Flow.Launcher/Storage/QueryHistory.cs index 2b2103605..a5383b179 100644 --- a/Flow.Launcher/Storage/QueryHistory.cs +++ b/Flow.Launcher/Storage/QueryHistory.cs @@ -1,13 +1,14 @@ using System; using System.Collections.Generic; using System.Linq; -using Flow.Launcher.Plugin; +using System.Text.Json.Serialization; namespace Flow.Launcher.Storage { public class History { - public List Items { get; set; } = new List(); + [JsonInclude] + public List Items { get; private set; } = new List(); private int _maxHistory = 300; diff --git a/Flow.Launcher/Storage/TopMostRecord.cs b/Flow.Launcher/Storage/TopMostRecord.cs index c92ef4956..052c296cd 100644 --- a/Flow.Launcher/Storage/TopMostRecord.cs +++ b/Flow.Launcher/Storage/TopMostRecord.cs @@ -1,6 +1,4 @@ using System.Collections.Generic; -using System.Linq; -using System.Text.Json; using System.Text.Json.Serialization; using Flow.Launcher.Plugin; @@ -9,14 +7,8 @@ namespace Flow.Launcher.Storage // todo this class is not thread safe.... but used from multiple threads. public class TopMostRecord { - /// - /// You should not directly access this field - /// - /// It is public due to System.Text.Json limitation in version 3.1 - /// - /// - /// TODO: Set it to private - public Dictionary records { get; set; } = new Dictionary(); + [JsonInclude] + public Dictionary records { get; private set; } = new Dictionary(); internal bool IsTopMost(Result result) { diff --git a/Flow.Launcher/Storage/UserSelectedRecord.cs b/Flow.Launcher/Storage/UserSelectedRecord.cs index bc7a2da73..fd3d87fc4 100644 --- a/Flow.Launcher/Storage/UserSelectedRecord.cs +++ b/Flow.Launcher/Storage/UserSelectedRecord.cs @@ -7,15 +7,8 @@ namespace Flow.Launcher.Storage { public class UserSelectedRecord { - /// - /// You should not directly access this field - /// - /// It is public due to System.Text.Json limitation in version 3.1 - /// - /// - /// TODO: Set it to private - [JsonPropertyName("records")] - public Dictionary records { get; set; } + [JsonInclude] + public Dictionary records { get; private set; } public UserSelectedRecord() {