Apply suggestions from code review

Co-Authored-By: Travis Ralston <travpc@gmail.com>
This commit is contained in:
Stuart Mumford 2020-02-28 10:47:23 +00:00 committed by GitHub
parent c96dd9715a
commit aec622d5d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 19 deletions

View file

@ -75,20 +75,14 @@ export async function startAnyRegistrationFlow(options) {
description: _t("Use your account or create a new one to continue."),
button: _t("Create Account"),
extraButtons: [
<button key="start_login"
onClick={() => {
<button key="start_login" onClick={() => {
modal.close();
dis.dispatch({action: 'start_login',
screenAfterLogin: options.screen_after});
}
}>
{ _t('Sign In') }
</button>,
dis.dispatch({action: 'start_login', screenAfterLogin: options.screen_after});
}}>{ _t('Sign In') }</button>,
],
onFinished: (proceed) => {
if (proceed) {
dis.dispatch({action: 'start_registration',
screenAfterLogin: options.screen_after});
dis.dispatch({action: 'start_registration', screenAfterLogin: options.screen_after});
} else if (options.go_home_on_cancel) {
dis.dispatch({action: 'view_home_page'});
} else if (options.go_welcome_on_cancel) {

View file

@ -481,8 +481,7 @@ export default createReactClass({
group_id: groupId,
},
});
dis.dispatch({action: 'require_registration',
screen_after: {screen: `group/${groupId}`}});
dis.dispatch({action: 'require_registration', screen_after: {screen: `group/${groupId}`}});
willDoOnboarding = true;
}
if (stateKey === GroupStore.STATE_KEY.Summary) {
@ -727,8 +726,7 @@ export default createReactClass({
_onJoinClick: async function() {
if (this._matrixClient.isGuest()) {
dis.dispatch({action: 'require_registration',
screen_after: {screen: `group/${this.props.groupId}`}});
dis.dispatch({action: 'require_registration', screen_after: {screen: `group/${this.props.groupId}`}});
return;
}

View file

@ -1008,10 +1008,9 @@ export default createReactClass({
// needs to be reset so that they can revisit /user/.. // (and trigger
// `_chatCreateOrReuse` again)
go_welcome_on_cancel: true,
screen_after: {screen: `user/${this.props.config.welcomeUserId}`,
params: {
action: 'chat',
},
screen_after: {
screen: `user/${this.props.config.welcomeUserId}`,
params: { action: 'chat' },
},
});
return;