[Glitch] Fix custom signup URL may not loaded

Port 8d2c26834f to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
pull/62/head
mogaminsk 2023-06-22 19:10:49 +09:00 committed by Claire
parent 6fe345c383
commit 222713a768
1 changed files with 10 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import { Link, withRouter } from 'react-router-dom';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { openModal } from 'flavours/glitch/actions/modal'; import { openModal } from 'flavours/glitch/actions/modal';
import { fetchServer } from 'flavours/glitch/actions/server';
import { Avatar } from 'flavours/glitch/components/avatar'; import { Avatar } from 'flavours/glitch/components/avatar';
import { WordmarkLogo, SymbolLogo } from 'flavours/glitch/components/logo'; import { WordmarkLogo, SymbolLogo } from 'flavours/glitch/components/logo';
import Permalink from 'flavours/glitch/components/permalink'; import Permalink from 'flavours/glitch/components/permalink';
@ -29,6 +30,9 @@ const mapDispatchToProps = (dispatch) => ({
openClosedRegistrationsModal() { openClosedRegistrationsModal() {
dispatch(openModal({ modalType: 'CLOSED_REGISTRATIONS' })); dispatch(openModal({ modalType: 'CLOSED_REGISTRATIONS' }));
}, },
dispatchServer() {
dispatch(fetchServer());
}
}); });
class Header extends PureComponent { class Header extends PureComponent {
@ -41,8 +45,14 @@ class Header extends PureComponent {
openClosedRegistrationsModal: PropTypes.func, openClosedRegistrationsModal: PropTypes.func,
location: PropTypes.object, location: PropTypes.object,
signupUrl: PropTypes.string.isRequired, signupUrl: PropTypes.string.isRequired,
dispatchServer: PropTypes.func
}; };
componentDidMount () {
const { dispatchServer } = this.props;
dispatchServer();
}
render () { render () {
const { signedIn } = this.context.identity; const { signedIn } = this.context.identity;
const { location, openClosedRegistrationsModal, signupUrl } = this.props; const { location, openClosedRegistrationsModal, signupUrl } = this.props;