Skip to content

Commit

Permalink
set account.isLoading
Browse files Browse the repository at this point in the history
  • Loading branch information
arosiclair committed Nov 7, 2024
1 parent 8fc5566 commit ee38879
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/libs/actions/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
}

Expand Down

0 comments on commit ee38879

Please sign in to comment.