Skip to content

Commit

Permalink
Merge pull request #19480 from Pujan92/fix/18827
Browse files Browse the repository at this point in the history
Fix: 'Link sent!' message is not dynamically updated when changing language preference
  • Loading branch information
cristipaval authored Jun 9, 2023
2 parents 82ce35f + 1843c73 commit 0a947cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 42 deletions.
42 changes: 1 addition & 41 deletions src/libs/actions/Session/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,45 +197,6 @@ function resendValidateCode(login = credentials.login) {
API.write('RequestNewValidateCode', {email: login}, {optimisticData, successData, failureData});
}

/**
* Request a new validate / magic code for user to sign in automatically with the link
*
* @param {String} [login]
*/
function resendLinkWithValidateCode(login = credentials.login) {
const optimisticData = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.ACCOUNT,
value: {
isLoading: true,
message: null,
},
},
];
const successData = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.ACCOUNT,
value: {
isLoading: false,
message: Localize.translateLocal('validateCodeModal.successfulNewCodeRequest'),
},
},
];
const failureData = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.ACCOUNT,
value: {
isLoading: false,
message: null,
},
},
];
API.write('RequestNewValidateCode', {email: login}, {optimisticData, successData, failureData});
}

/**
* Checks the API to see if an account exists for the given login
*
Expand Down Expand Up @@ -768,7 +729,7 @@ function requestUnlinkValidationLink() {
key: ONYXKEYS.ACCOUNT,
value: {
isLoading: false,
message: Localize.translateLocal('unlinkLoginForm.linkSent'),
message: 'unlinkLoginForm.linkSent',
loadingForm: null,
},
},
Expand Down Expand Up @@ -926,7 +887,6 @@ export {
signOutAndRedirectToSignIn,
resendValidationLink,
resendValidateCode,
resendLinkWithValidateCode,
resetPassword,
resendResetPassword,
requestUnlinkValidationLink,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/signin/UnlinkLoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const UnlinkLoginForm = (props) => {
<DotIndicatorMessage
style={[styles.mb5, styles.flex0]}
type="success"
messages={{0: props.account.message}}
messages={{0: props.translate(props.account.message)}}
/>
)}
{!_.isEmpty(props.account.errors) && (
Expand Down

0 comments on commit 0a947cc

Please sign in to comment.