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

Fix going back from magic code page after refresh doesn't show the submitted email #30228

Merged
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
12 changes: 11 additions & 1 deletion src/pages/signin/LoginForm/BaseLoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ const propTypes = {
success: PropTypes.string,
}),

/** The credentials of the logged in person */
credentials: PropTypes.shape({
/** The email the user logged in with */
login: PropTypes.string,
}),

/** Props to detect online status */
network: networkPropTypes.isRequired,

Expand All @@ -78,6 +84,9 @@ const propTypes = {

const defaultProps = {
account: {},
credentials: {
login: '',
},
closeAccount: {},
blurOnSubmit: false,
innerRef: () => {},
Expand All @@ -86,7 +95,7 @@ const defaultProps = {

function LoginForm(props) {
const input = useRef();
const [login, setLogin] = useState('');
const [login, setLogin] = useState(() => Str.removeSMSDomain(props.credentials.login));
const [formError, setFormError] = useState(false);
const prevIsVisible = usePrevious(props.isVisible);

Expand Down Expand Up @@ -289,6 +298,7 @@ export default compose(
withNavigationFocus,
withOnyx({
account: {key: ONYXKEYS.ACCOUNT},
credentials: {key: ONYXKEYS.CREDENTIALS},
closeAccount: {key: ONYXKEYS.FORMS.CLOSE_ACCOUNT_FORM},
}),
withWindowDimensions,
Expand Down
Loading