From 4c2928218f26daff791ccfe72b382be09571fcbe Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Fri, 3 Mar 2017 16:18:47 -0500 Subject: [PATCH] PLT-5695 Fixed replying in DM threads (#320) --- app/scenes/thread/thread_container.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/scenes/thread/thread_container.js b/app/scenes/thread/thread_container.js index 3485dd426..0e3593067 100644 --- a/app/scenes/thread/thread_container.js +++ b/app/scenes/thread/thread_container.js @@ -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] || '',