Add basic invite route, fix Chats fetch

merge-requests/779/head
Alex Gleason 3 years ago
parent 4fcb5f0239
commit 937cc18012
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

@ -167,13 +167,6 @@ class RegistrationForm extends ImmutablePureComponent {
<SimpleForm onSubmit={this.onSubmit}> <SimpleForm onSubmit={this.onSubmit}>
<fieldset disabled={isLoading || !isOpen}> <fieldset disabled={isLoading || !isOpen}>
<div className='simple_form__overlay-area'> <div className='simple_form__overlay-area'>
<p className='lead'>
<FormattedMessage
id='registration.lead'
defaultMessage="With an account on {instance} you'll be able to follow people on any server in the fediverse."
values={{ instance: <strong>{instance.get('title')}</strong> }}
/>
</p>
<div className='fields-group'> <div className='fields-group'>
<TextInput <TextInput
placeholder={intl.formatMessage(messages.username)} placeholder={intl.formatMessage(messages.username)}

@ -0,0 +1,10 @@
import React from 'react';
import RegistrationForm from 'soapbox/features/auth_login/components/registration_form';
export default class RegisterInvite extends React.PureComponent {
render() {
return <RegistrationForm />;
}
}

@ -106,6 +106,7 @@ import {
NotificationsContainer, NotificationsContainer,
ModalContainer, ModalContainer,
ProfileHoverCard, ProfileHoverCard,
RegisterInvite,
} from './util/async-components'; } from './util/async-components';
// Dummy import, to make sure that <Status /> ends up in the application bundle. // Dummy import, to make sure that <Status /> ends up in the application bundle.
@ -275,6 +276,9 @@ class SwitchingColumnsArea extends React.PureComponent {
<WrappedRoute path='/statuses/:statusId' exact component={Status} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/statuses/:statusId' exact component={Status} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} />
<WrappedRoute path='/scheduled_statuses' page={DefaultPage} component={ScheduledStatuses} content={children} /> <WrappedRoute path='/scheduled_statuses' page={DefaultPage} component={ScheduledStatuses} content={children} />
<Redirect from='/registration/:token' to='/invite/:token' />
<WrappedRoute path='/invite/:token' component={RegisterInvite} content={children} publicRoute />
<Redirect exact from='/settings' to='/settings/preferences' /> <Redirect exact from='/settings' to='/settings/preferences' />
<WrappedRoute path='/settings/preferences' page={DefaultPage} component={Preferences} content={children} /> <WrappedRoute path='/settings/preferences' page={DefaultPage} component={Preferences} content={children} />
<WrappedRoute path='/settings/profile' page={DefaultPage} component={EditProfile} content={children} /> <WrappedRoute path='/settings/profile' page={DefaultPage} component={EditProfile} content={children} />
@ -482,9 +486,9 @@ class UI extends React.PureComponent {
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
this.connectStreaming(); this.connectStreaming();
const { dispatch, features } = this.props; const { dispatch, account, features } = this.props;
if (features.chats && !prevProps.features.chats) { if (features.chats && account && !prevProps.features.chats) {
dispatch(fetchChats()); dispatch(fetchChats());
} }
} }

@ -401,3 +401,7 @@ export function WhoToFollowPanel() {
export function FollowRecommendations() { export function FollowRecommendations() {
return import(/* webpackChunkName: "features/follow_recommendations" */'../../follow_recommendations'); return import(/* webpackChunkName: "features/follow_recommendations" */'../../follow_recommendations');
} }
export function RegisterInvite() {
return import(/* webpackChunkName: "features/register_invite" */'../../register_invite');
}

Loading…
Cancel
Save