From 8c78a128e1d6c1b05251c71a8a95b88ccd9b9dc0 Mon Sep 17 00:00:00 2001 From: mogaminsk Date: Mon, 14 Aug 2023 19:04:04 +0900 Subject: [PATCH] [Glitch] Fix "Create Account" button in interaction modal Port 10651d8b8ab269ab98ba71aa41993038605a6381 to glitch-soc Signed-off-by: Claire --- .../glitch/features/interaction_modal/index.jsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/javascript/flavours/glitch/features/interaction_modal/index.jsx b/app/javascript/flavours/glitch/features/interaction_modal/index.jsx index 3375afde6f..bbfa9af8d4 100644 --- a/app/javascript/flavours/glitch/features/interaction_modal/index.jsx +++ b/app/javascript/flavours/glitch/features/interaction_modal/index.jsx @@ -21,12 +21,16 @@ const messages = defineMessages({ const mapStateToProps = (state, { accountId }) => ({ displayNameHtml: state.getIn(['accounts', accountId, 'display_name_html']), + signupUrl: state.getIn(['server', 'server', 'registrations', 'url'], null) || '/auth/sign_up', }); const mapDispatchToProps = (dispatch) => ({ onSignupClick() { - dispatch(closeModal()); - dispatch(openModal('CLOSED_REGISTRATIONS')); + dispatch(closeModal({ + modalType: undefined, + ignoreFocus: false, + })); + dispatch(openModal({ modalType: 'CLOSED_REGISTRATIONS' })); }, }); @@ -294,6 +298,7 @@ class InteractionModal extends React.PureComponent { url: PropTypes.string, type: PropTypes.oneOf(['reply', 'reblog', 'favourite', 'follow']), onSignupClick: PropTypes.func.isRequired, + signupUrl: PropTypes.string.isRequired, }; handleSignupClick = () => { @@ -301,7 +306,7 @@ class InteractionModal extends React.PureComponent { }; render () { - const { url, type, displayNameHtml } = this.props; + const { url, type, displayNameHtml, signupUrl } = this.props; const name = ; @@ -340,7 +345,7 @@ class InteractionModal extends React.PureComponent { ); } else if (registrationsOpen) { signupButton = ( - + );