Chats: fetch chats in UI instead of chat list, fixes #384

This commit is contained in:
Alex Gleason
2020-09-03 14:18:11 -05:00
parent 57fc08771c
commit 9d7b86935f
2 changed files with 2 additions and 5 deletions

View File

@ -3,7 +3,6 @@ import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { injectIntl } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { fetchChats } from 'soapbox/actions/chats';
import Chat from './chat';
import { makeGetChat } from 'soapbox/selectors';
@ -42,10 +41,6 @@ class ChatList extends ImmutablePureComponent {
emptyMessage: PropTypes.node,
};
componentDidMount() {
this.props.dispatch(fetchChats());
}
render() {
const { chats, emptyMessage } = this.props;

View File

@ -18,6 +18,7 @@ import { expandHomeTimeline } from '../../actions/timelines';
import { expandNotifications } from '../../actions/notifications';
import { fetchReports } from '../../actions/admin';
import { fetchFilters } from '../../actions/filters';
import { fetchChats } from 'soapbox/actions/chats';
import { clearHeight } from '../../actions/height_cache';
import { openModal } from '../../actions/modal';
import { WrappedRoute } from './util/react_router_helpers';
@ -433,6 +434,7 @@ class UI extends React.PureComponent {
if (account) {
this.props.dispatch(expandHomeTimeline());
this.props.dispatch(expandNotifications());
this.props.dispatch(fetchChats());
// this.props.dispatch(fetchGroups('member'));
if (isStaff(account))
this.props.dispatch(fetchReports({ state: 'open' }));