Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/projects/detail/containers/FeedContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/projects/detail/containers/MessagesContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down