Skip to content

Commit 8d10f53

Browse files
committed
fix issue #2663 - Post content lost if posting failed
1 parent 60bfa17 commit 8d10f53

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/components/Feed/Feed.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ class Feed extends React.Component {
180180
isFullScreen={isFullScreen}
181181
headerHeight={headerHeight}
182182
commentId={commentId}
183+
error={error}
183184
/>
184185
{children}
185186
{isDeletingTopic &&

src/projects/detail/containers/PhaseFeedHOC.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const phaseFeedHOC = (Component) => {
5555
* which is accepted by Feed component
5656
*/
5757
prepareFeed() {
58-
const { topic, allMembers, currentMemberRole, phase } = this.props
58+
const { topic, error, allMembers, currentMemberRole, phase } = this.props
5959
const { showAll } = this.state
6060

6161
if (!topic) {
@@ -64,6 +64,7 @@ const phaseFeedHOC = (Component) => {
6464

6565
const feed = {
6666
...topic,
67+
error,
6768
// Github issue##623, allow comments on all posts (including system posts)
6869
allowComments: true,
6970
user: isSystemUser(topic.userId) ? SYSTEM_USER : allMembers[topic.userId],
@@ -170,10 +171,10 @@ const phaseFeedHOC = (Component) => {
170171

171172
const mapStateToProps = ({ phasesTopics, loadUser, members, productsTimelines, notifications }, props) => {
172173
const product = _.get(props.phase, 'products[0]')
174+
const phaseTopicState = phasesTopics[props.phase.id] || {}
175+
173176
return {
174-
topic: _.get(phasesTopics[props.phase.id], 'topic'),
175-
isLoading: _.get(phasesTopics[props.phase.id], 'isLoading', false),
176-
isAddingComment: _.get(phasesTopics[props.phase.id], 'isAddingComment', false),
177+
...phaseTopicState,
177178
currentUser: loadUser.user,
178179
allMembers: members.members,
179180
timeline: _.get(productsTimelines[product.id], 'timeline'),

0 commit comments

Comments
 (0)