From 9d7b86935f3299df58855db3faae339b8a7bb93b Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 3 Sep 2020 14:18:11 -0500 Subject: [PATCH] Chats: fetch chats in UI instead of chat list, fixes #384 --- app/soapbox/features/chats/components/chat_list.js | 5 ----- app/soapbox/features/ui/index.js | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/soapbox/features/chats/components/chat_list.js b/app/soapbox/features/chats/components/chat_list.js index 41aae6397..e24d31ab9 100644 --- a/app/soapbox/features/chats/components/chat_list.js +++ b/app/soapbox/features/chats/components/chat_list.js @@ -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; diff --git a/app/soapbox/features/ui/index.js b/app/soapbox/features/ui/index.js index 59269d577..ff80086ee 100644 --- a/app/soapbox/features/ui/index.js +++ b/app/soapbox/features/ui/index.js @@ -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' }));