Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display loading spinner while authenticating from validate code link #15311

Merged
merged 2 commits into from
Mar 2, 2023
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
9 changes: 5 additions & 4 deletions src/pages/ValidateLoginPage/index.website.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ class ValidateLoginPage extends Component {
isAuthenticated = () => Boolean(lodashGet(this.props, 'session.authToken', null));

/**
* Where SignIn was initiated on the current browser.
* Whether SignIn was initiated on the current browser.
* @returns {Boolean}
*/
isSignInInitiated = () => !this.isAuthenticated() && this.props.credentials && this.props.credentials.login;
isSignInInitiated = () => !this.isAuthenticated() && lodashGet(this.props, 'credentials.login', null);

render() {
return (
this.isOnPasswordlessBeta()
this.isOnPasswordlessBeta() && !this.isSignInInitiated() && !lodashGet(this.props, 'account.isLoading', true)
? (
<ValidateCodeModal
isSuccessfullySignedIn={this.state.justSignedIn}
Expand All @@ -109,8 +109,9 @@ ValidateLoginPage.defaultProps = defaultProps;
export default compose(
withLocalize,
withOnyx({
account: {key: ONYXKEYS.ACCOUNT},
betas: {key: ONYXKEYS.BETAS},
session: {key: ONYXKEYS.SESSION},
credentials: {key: ONYXKEYS.CREDENTIALS},
session: {key: ONYXKEYS.SESSION},
}),
)(ValidateLoginPage);