diff --git a/src/libs/actions/User.ts b/src/libs/actions/User.ts index eaccbb8497ac..f3b8b1a15c28 100644 --- a/src/libs/actions/User.ts +++ b/src/libs/actions/User.ts @@ -555,6 +555,16 @@ function validateLogin(accountID: number, validateCode: string) { Onyx.merge(ONYXKEYS.ACCOUNT, {...CONST.DEFAULT_ACCOUNT_DATA, isLoading: true}); const optimisticData: OnyxUpdate[] = [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: ONYXKEYS.ACCOUNT, + value: { + isLoading: true, + }, + }, + ]; + + const finallyData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.ACCOUNT, @@ -566,7 +576,7 @@ function validateLogin(accountID: number, validateCode: string) { const parameters: ValidateLoginParams = {accountID, validateCode}; - API.write(WRITE_COMMANDS.VALIDATE_LOGIN, parameters, {optimisticData}); + API.write(WRITE_COMMANDS.VALIDATE_LOGIN, parameters, {optimisticData, finallyData}); Navigation.navigate(ROUTES.HOME); }