Skip to content

Commit 1947080

Browse files
committed
Always ensure to flush CommunityTools Dictionary
1 parent 317d6e5 commit 1947080

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CollapseLauncher/Classes/Helper/Metadata/LauncherMetadataHelper.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ internal static async Task InitializeStamp(string currentChannel, bool throwAfte
228228

229229
// Initialize and clear the stamp dictionary
230230
LauncherMetadataStampDictionary ??= new Dictionary<string, Stamp>();
231-
232231
LauncherMetadataStampDictionary.Clear();
233232

234233
FileStream? stampLocalStream = null;
@@ -351,6 +350,8 @@ internal static async Task InitializeConfig(string currentChannel,
351350
// Initialize the community tools properties
352351
PageStatics.CommunityToolsProperty ??= new CommunityToolsProperty();
353352
PageStatics.CommunityToolsProperty.Clear();
353+
PageStatics.CommunityToolsProperty.OfficialToolsDictionary?.Clear();
354+
PageStatics.CommunityToolsProperty.CommunityToolsDictionary?.Clear();
354355

355356
#region Master Key Loading
356357
// Load master key config
@@ -471,12 +472,12 @@ async ValueTask LoadRegionMetadataConfig((int, (Stamp?, ConcurrentDictionary<str
471472

472473
foreach (KeyValuePair<GameNameType, List<CommunityToolsEntry>> entry in communityToolsProperty.OfficialToolsDictionary ?? [])
473474
{
474-
PageStatics.CommunityToolsProperty.OfficialToolsDictionary?.Add(entry.Key, entry.Value);
475+
PageStatics.CommunityToolsProperty.OfficialToolsDictionary?.TryAdd(entry.Key, entry.Value);
475476
}
476477

477478
foreach (KeyValuePair<GameNameType, List<CommunityToolsEntry>> entry in communityToolsProperty.CommunityToolsDictionary ?? [])
478479
{
479-
PageStatics.CommunityToolsProperty.CommunityToolsDictionary?.Add(entry.Key, entry.Value);
480+
PageStatics.CommunityToolsProperty.CommunityToolsDictionary?.TryAdd(entry.Key, entry.Value);
480481
}
481482
}
482483
#endregion

CollapseLauncher/XAMLs/MainApp/Pages/OOBE/OOBEStartUpMenu.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ private async void PrepareMetadataAndApplySettings()
904904
Lang._StartupPage.Pg1LoadingSubitle2);
905905
LoadingMessageHelper.SetProgressBarState(100, false);
906906
LoadingMessageHelper.SetProgressBarValue(100);
907-
await Task.Delay(5000);
907+
await Task.Delay(2000);
908908

909909
LoadingMessageHelper.HideLoadingFrame();
910910
}

0 commit comments

Comments
 (0)