Skip to content

Commit

Permalink
fix: cancel login after patching game
Browse files Browse the repository at this point in the history
  • Loading branch information
Bluefissure committed Aug 13, 2023
1 parent 5940faa commit 5bcc659
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/XIVLauncher.Core/Components/MainPage/MainPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ private async Task<bool> TryProcessLoginResult(Launcher.LoginResult loginResult,
return false;
}

loginResult.State = Launcher.LoginState.Ok;
action = LoginAction.Game;
App.ShowMessageBlocking("Game is successfully patched, you can login now.");
return false;
}

if (loginResult.State == Launcher.LoginState.NeedRetry)
Expand All @@ -430,9 +430,11 @@ private async Task<bool> TryProcessLoginResult(Launcher.LoginResult loginResult,

Debug.Assert(loginResult.State == Launcher.LoginState.Ok);

if (loginResult.State == Launcher.LoginState.Ok && App.Accounts.CurrentAccount != null && loginResult.OauthLogin?.AutoLoginSessionKey != string.Empty)
if (loginResult.State == Launcher.LoginState.Ok
&& App.Accounts.CurrentAccount != null
&& !String.IsNullOrEmpty(loginResult.OauthLogin?.AutoLoginSessionKey))
{
App.Accounts.CurrentAccount.AutoLoginSessionKey = loginResult.OauthLogin!.AutoLoginSessionKey;
App.Accounts.CurrentAccount.AutoLoginSessionKey = loginResult.OauthLogin.AutoLoginSessionKey;
App.Accounts.Save();
}

Expand Down

0 comments on commit 5bcc659

Please sign in to comment.