PLT-5695 Fixed replying in DM threads (#320)

This commit is contained in:
Harrison Healey 2017-03-03 16:18:47 -05:00 committed by enahum
parent 49c31620a8
commit 4c2928218f

View file

@ -8,6 +8,7 @@ import {selectPost} from 'service/actions/posts';
import {makeGetPostsForThread} from 'service/selectors/entities/posts';
import {getTheme} from 'service/selectors/entities/preferences';
import {getCurrentTeamId} from 'service/selectors/entities/teams';
import navigationSceneConnect from '../navigationSceneConnect';
import Thread from './thread';
@ -20,9 +21,15 @@ function makeMapStateToProps() {
return function mapStateToProps(state, ownProps) {
const posts = getPostsForThread(state, ownProps);
let teamId = state.entities.channels.channels[ownProps.channelId].team_id;
if (!teamId) {
// We can't make a post without a team id, so get it from the current team
teamId = getCurrentTeamId(state);
}
return {
...ownProps,
teamId: state.entities.channels.channels[ownProps.channelId].team_id,
teamId,
channelId: ownProps.channelId,
rootId: ownProps.rootId,
draft: state.views.thread.draft[ownProps.rootId] || '',