diff --git a/TcNo-Acc-Switcher-Server/Pages/Steam/SteamSwitcherFuncs.cs b/TcNo-Acc-Switcher-Server/Pages/Steam/SteamSwitcherFuncs.cs index c407ded36..bcc82e6de 100644 --- a/TcNo-Acc-Switcher-Server/Pages/Steam/SteamSwitcherFuncs.cs +++ b/TcNo-Acc-Switcher-Server/Pages/Steam/SteamSwitcherFuncs.cs @@ -561,11 +561,27 @@ public static void PrepareProfile(string steamId, bool noCache) { Globals.WriteToLog("Failed to load Steam account XML. ", e); // Issue was caused by web. Throw. - if (!File.Exists(cachedFile)) throw; + if (!File.Exists(cachedFile)) + { + _ = GeneralInvocableFuncs.ShowToast("error", Lang["Toast_SteamCantLoadXml", new { steamId = su.SteamId }], + renderTo: "toastarea"); + return; + } + Globals.DeleteFile(cachedFile); Globals.WriteToLog("The issue was the local XML file. It has been deleted and re-downloaded."); + // Issue was caused by cached fil. Delete, and re-download. - profileXml.Load($"https://steamcommunity.com/profiles/{su.SteamId}?xml=1"); + try + { + profileXml.Load($"https://steamcommunity.com/profiles/{su.SteamId}?xml=1"); + } + catch (Exception ex) + { + Globals.WriteToLog("Failed to download profile XML info", ex); + _ = GeneralInvocableFuncs.ShowToast("error", Lang["Toast_SteamCantLoadXml", new { steamId = su.SteamId }], + renderTo: "toastarea"); + } } if (!File.Exists(cachedFile)) profileXml.Save(cachedFile); diff --git a/TcNo-Acc-Switcher-Server/Resources/en-US.yml b/TcNo-Acc-Switcher-Server/Resources/en-US.yml index 28b5fde64..bbb96f80e 100644 --- a/TcNo-Acc-Switcher-Server/Resources/en-US.yml +++ b/TcNo-Acc-Switcher-Server/Resources/en-US.yml @@ -192,6 +192,7 @@ Toast_NoValidSteamId: Unable to find a valid Steam ID. Toast_FailedUpdateCheck: Failed to check for updates Toast_UpdateVerifyFail: Can't verify updater files. Download latest version and replace files in your directory. Toast_StartedGame: Started {program} +Toast_SteamCantLoadXml: Couldn't get XML info for {steamId}. See log for more details. Toast_Steam_VacCleared: VAC status for accounts was cleared Toast_Steam_CantDeleteVacCache: Could not delete 'LoginCache/Steam/VACCache/SteamVACCache.json' Toast_NoFindSteamUserdata: Could not find Steam\\userdata folder diff --git a/TcNo-Acc-Switcher-Server/themes/Monokai/style.scss b/TcNo-Acc-Switcher-Server/themes/Monokai/style.scss index 3ae0fe0e6..d743dfbbc 100644 --- a/TcNo-Acc-Switcher-Server/themes/Monokai/style.scss +++ b/TcNo-Acc-Switcher-Server/themes/Monokai/style.scss @@ -183,9 +183,8 @@ input[type="checkbox"] + label { } .platform_list { - top: 28px; + min-height: 100%; max-height: 100%; - padding: 100px; display: flex; flex-flow: row wrap; justify-content: center; @@ -235,10 +234,10 @@ input[type="checkbox"] + label { .platformTable { width: 100%; - max-height: calc(100% - 56px); + max-height: 100%; position: relative; - display: table; text-align: center; + padding-bottom: 3.5em; } use.icoGlass {