From aec622d5d086ed43ad238935e9908d1b42d1158e Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 28 Feb 2020 10:47:23 +0000 Subject: [PATCH] Apply suggestions from code review Co-Authored-By: Travis Ralston --- src/Registration.js | 14 ++++---------- src/components/structures/GroupView.js | 6 ++---- src/components/structures/MatrixChat.js | 9 ++++----- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/Registration.js b/src/Registration.js index 5f6ac4b68e..ca162bac03 100644 --- a/src/Registration.js +++ b/src/Registration.js @@ -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: [ - , + dis.dispatch({action: 'start_login', screenAfterLogin: options.screen_after}); + }}>{ _t('Sign In') }, ], 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) { diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index 2b7f15df7a..af90fbbe83 100644 --- a/src/components/structures/GroupView.js +++ b/src/components/structures/GroupView.js @@ -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; } diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index e226b6aaf7..448cce933d 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1008,11 +1008,10 @@ 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; }