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."), description: _t("Use your account or create a new one to continue."),
button: _t("Create Account"), button: _t("Create Account"),
extraButtons: [ extraButtons: [
<button key="start_login" <button key="start_login" onClick={() => {
onClick={() => {
modal.close(); modal.close();
dis.dispatch({action: 'start_login', dis.dispatch({action: 'start_login', screenAfterLogin: options.screen_after});
screenAfterLogin: options.screen_after}); }}>{ _t('Sign In') }</button>,
}
}>
{ _t('Sign In') }
</button>,
], ],
onFinished: (proceed) => { onFinished: (proceed) => {
if (proceed) { if (proceed) {
dis.dispatch({action: 'start_registration', dis.dispatch({action: 'start_registration', screenAfterLogin: options.screen_after});
screenAfterLogin: options.screen_after});
} else if (options.go_home_on_cancel) { } else if (options.go_home_on_cancel) {
dis.dispatch({action: 'view_home_page'}); dis.dispatch({action: 'view_home_page'});
} else if (options.go_welcome_on_cancel) { } else if (options.go_welcome_on_cancel) {

View file

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

View file

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