mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 20:38:55 +03:00
Provide an escape from the registration process
Fixes https://github.com/vector-im/riot-web/issues/6560 Would be better improved by https://github.com/matrix-org/matrix-doc/pull/1921 or similar in the future.
This commit is contained in:
parent
1165c51c77
commit
9794e32f48
1 changed files with 21 additions and 0 deletions
|
@ -366,6 +366,17 @@ module.exports = React.createClass({
|
|||
this.props.onLoginClick();
|
||||
},
|
||||
|
||||
onGoToFormClicked(ev) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
this._replaceClient();
|
||||
this.setState({
|
||||
busy: false,
|
||||
doingUIAuth: false,
|
||||
phase: PHASE_REGISTRATION,
|
||||
});
|
||||
},
|
||||
|
||||
onServerDetailsNextPhaseClick(ev) {
|
||||
ev.stopPropagation();
|
||||
this.setState({
|
||||
|
@ -549,6 +560,15 @@ module.exports = React.createClass({
|
|||
{ _t('Sign in instead') }
|
||||
</a>;
|
||||
|
||||
let goBack = <a className="mx_AuthBody_changeFlow" onClick={this.onGoToFormClicked} href="#">
|
||||
{ _t('Go back') }
|
||||
</a>;
|
||||
|
||||
// Don't show the 'go back' button in one specific case: when you're staring at the form.
|
||||
if ((PHASES_ENABLED && this.state.phase === PHASE_REGISTRATION) && !this.state.doingUIAuth) {
|
||||
goBack = null;
|
||||
}
|
||||
|
||||
return (
|
||||
<AuthPage>
|
||||
<AuthHeader />
|
||||
|
@ -557,6 +577,7 @@ module.exports = React.createClass({
|
|||
{ errorText }
|
||||
{ this.renderServerComponent() }
|
||||
{ this.renderRegisterComponent() }
|
||||
{ goBack }
|
||||
{ signIn }
|
||||
</AuthBody>
|
||||
</AuthPage>
|
||||
|
|
Loading…
Reference in a new issue