Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions src/libs/actions/Session/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,33 +170,11 @@ function resendValidateCode(login = credentials.login) {
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.ACCOUNT,
value: {
isLoading: true,
errors: null,
loadingForm: CONST.FORMS.VALIDATE_CODE_FORM,
},
},
];
const successData = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.ACCOUNT,
value: {
isLoading: false,
loadingForm: null,
},
},
];
const failureData = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.ACCOUNT,
value: {
isLoading: false,
loadingForm: null,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reasoning for removing these entirely versus copying the changes to each?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to show any loading indicator when resending a new magic code, so both success and failure data is not needed since we don't change the loading state (isLoading and loadingForm)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit late but loadingForm is still needed to fix #21293.
Only isLoading can be removed here.

},
];
API.write('RequestNewValidateCode', {email: login}, {optimisticData, successData, failureData});
API.write('RequestNewValidateCode', {email: login}, {optimisticData});
}

/**
Expand Down