diff --git a/Project-Aurora/Project-Aurora/Modules/OnlineConfigs/OnlineConfigsRepository.cs b/Project-Aurora/Project-Aurora/Modules/OnlineConfigs/OnlineConfigsRepository.cs index e8dfb0398..1fd43cb7a 100644 --- a/Project-Aurora/Project-Aurora/Modules/OnlineConfigs/OnlineConfigsRepository.cs +++ b/Project-Aurora/Project-Aurora/Modules/OnlineConfigs/OnlineConfigsRepository.cs @@ -31,13 +31,7 @@ public static async Task> GetDeviceTooltips() await using var jsonTextReader = new JsonTextReader(stream); var serializer = JsonSerializer.CreateDefault(); - var result = serializer.Deserialize>(jsonTextReader) ?? new Dictionary(); - - //Save to local cache - await using var jsonTextWriter = new JsonTextWriter(new StreamWriter(File.Create(DeviceTooltipsLocalCache))); - serializer.Serialize(jsonTextWriter, result); - - return result; + return serializer.Deserialize>(jsonTextReader) ?? new Dictionary(); } private static StreamReader GetJsonStream(string cachePath) diff --git a/Project-Aurora/Project-Aurora/Modules/OnlineSettings.cs b/Project-Aurora/Project-Aurora/Modules/OnlineSettings.cs index cbf6cb8e1..914479601 100644 --- a/Project-Aurora/Project-Aurora/Modules/OnlineSettings.cs +++ b/Project-Aurora/Project-Aurora/Modules/OnlineSettings.cs @@ -34,12 +34,13 @@ protected override async Task Initialize() { SystemEvents.SessionSwitch += SystemEvents_SessionSwitch; + await DownloadAndExtract(); await Refresh(); RunningProcessMonitor.Instance.RunningProcessesChanged += OnRunningProcessesChanged; } - private async Task Refresh() + private async Task DownloadAndExtract() { try { @@ -74,7 +75,10 @@ private async Task Refresh() _layoutUpdateTaskSource.TrySetResult(); Global.Configuration.OnlineSettingsTime = commitDate; + } + private async Task Refresh() + { try { await UpdateConflicts(); @@ -83,6 +87,7 @@ private async Task Refresh() { Global.logger.Error(e, "Failed to update conflicts"); } + try { await UpdateDeviceInfos(); @@ -132,6 +137,7 @@ private async void SystemEvents_SessionSwitch(object sender, SessionSwitchEventA { return; } + await DownloadAndExtract(); await Refresh(); }