GH-5166 Adding refresh during Instance Launch

In the login function of LaunchController, added requestRefresh on the current m_accountToUse.
This allows the accountState of accountToUse to be updated before running through what login is meant to depending on the accountState. This is to allow for the cases where a device might be back online after launching the Launcher. Putting this in the tryagain while loop also allows to check if a users account is expired during the login process.
This commit is contained in:
u7080498 2023-10-22 09:58:26 +11:00
parent 7450faaf13
commit e48134136a

View File

@ -117,6 +117,11 @@ void LaunchController::login() {
while (tryagain)
{
// Force account refresh on the account used to launch the instance,
// updating the AccountState everytime between instance launch
auto accounts = APPLICATION->accounts();
accounts->requestRefresh(m_accountToUse->internalId());
m_session = std::make_shared<AuthSession>();
m_session->wants_online = m_online;
m_accountToUse->fillSession(m_session);