File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
src/projects/detail/containers Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,12 @@ class FeedView extends React.Component {
130130
131131 init ( props , prevProps ) {
132132 const { feeds } = props
133+ let resetNewPost = false
134+ if ( prevProps ) {
135+ resetNewPost = prevProps . isCreatingFeed && ! props . isCreatingFeed && ! props . error
136+ }
133137 this . setState ( {
138+ newPost : resetNewPost ? { } : this . state . newPost ,
134139 feeds : feeds . map ( ( feed ) => {
135140 // finds the same feed from previous props, if exists
136141 let prevFeed
Original file line number Diff line number Diff line change @@ -145,8 +145,12 @@ class MessagesView extends React.Component {
145145 const activeThreadIndex = threadId
146146 ? _ . findIndex ( props . threads , ( thread ) => thread . id === threadId )
147147 : 0
148-
148+ let resetNewPost = false
149+ if ( prevProps ) {
150+ resetNewPost = prevProps . isCreatingFeed && ! props . isCreatingFeed && ! props . error
151+ }
149152 this . setState ( {
153+ newPost : resetNewPost ? { } : this . state . newPost ,
150154 scrollPosition : activeThreadIndex * 71 ,
151155 threads : props . threads . map ( ( thread , idx ) => {
152156 // finds the same thread from previous props, if exists
You can’t perform that action at this time.
0 commit comments