diff --git a/src/projects/detail/containers/FeedContainer.js b/src/projects/detail/containers/FeedContainer.js index 44be02ded..f2b60bd31 100644 --- a/src/projects/detail/containers/FeedContainer.js +++ b/src/projects/detail/containers/FeedContainer.js @@ -130,7 +130,12 @@ class FeedView extends React.Component { init(props, prevProps) { const { feeds } = props + let resetNewPost = false + if (prevProps) { + resetNewPost = prevProps.isCreatingFeed && !props.isCreatingFeed && !props.error + } this.setState({ + newPost: resetNewPost ? {} : this.state.newPost, feeds: feeds.map((feed) => { // finds the same feed from previous props, if exists let prevFeed diff --git a/src/projects/detail/containers/MessagesContainer.js b/src/projects/detail/containers/MessagesContainer.js index 34cbec399..44fdc238a 100644 --- a/src/projects/detail/containers/MessagesContainer.js +++ b/src/projects/detail/containers/MessagesContainer.js @@ -145,8 +145,12 @@ class MessagesView extends React.Component { const activeThreadIndex = threadId ? _.findIndex(props.threads, (thread) => thread.id === threadId ) : 0 - + let resetNewPost = false + if (prevProps) { + resetNewPost = prevProps.isCreatingFeed && !props.isCreatingFeed && !props.error + } this.setState({ + newPost: resetNewPost ? {} : this.state.newPost, scrollPosition: activeThreadIndex * 71, threads: props.threads.map((thread, idx) => { // finds the same thread from previous props, if exists