Skip to content

Commit

Permalink
delay showing banner at first time to avoid crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Scighost committed Jan 11, 2024
1 parent a227fee commit 7997fbb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Starward/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,9 @@ public static void DeleteAllSettings()
public static bool IsPlayingVideo { get; set; }


public static bool LauncherPageFirstLoaded { get; set; }



#endregion

Expand Down
7 changes: 6 additions & 1 deletion src/Starward/Pages/LauncherPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ protected override async void OnLoaded()
InitializePlayTime();
GetGameAccount();

await Task.Delay(150);
if (!AppConfig.LauncherPageFirstLoaded)
{
// 避免加载窗口和缓存图片同时进行可能导致的崩溃
await Task.Delay(150);
AppConfig.LauncherPageFirstLoaded = true;
}
await UpdateLauncherContentAsync();
await UpdateGameNoticesAlertAsync();
}
Expand Down

0 comments on commit 7997fbb

Please sign in to comment.