Skip to content

Commit ae0f34c

Browse files
committed
fix some actions with posts after fixing re-rendering
1 parent e338cc8 commit ae0f34c

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/components/Feed/Feed.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react'
2+
import _ from 'lodash'
23
import cn from 'classnames'
34
import moment from 'moment'
45
import PropTypes from 'prop-types'

src/projects/detail/containers/FeedContainer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ class FeedView extends React.Component {
5858
this.onNewPostChange = this.onNewPostChange.bind(this)
5959
this.onEditMessage = this.onEditMessage.bind(this)
6060
this.onSaveMessageChange = this.onSaveMessageChange.bind(this)
61+
this.onSaveMessage = this.onSaveMessage.bind(this)
62+
this.onDeleteMessage = this.onDeleteMessage.bind(this)
63+
this.onSaveTopic = this.onSaveTopic.bind(this)
64+
this.onDeleteTopic = this.onDeleteTopic.bind(this)
6165
this.onEditTopic = this.onEditTopic.bind(this)
6266
this.onTopicChange = this.onTopicChange.bind(this)
6367
this.onRefreshFeeds = this.onRefreshFeeds.bind(this)

src/projects/detail/containers/SingleFeedContainer.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ class SingleFeedContainer extends React.Component {
3535
super(props)
3636

3737
bindMethods.forEach((method) => {
38-
this[method] = () => this.props[method](this.props.id)
38+
// We cannot use an arrow function here, as later other component can apply .bind to these methods
39+
this[method] = function() {
40+
// we cannot use .bind here as we already bound "this" in these methods to another React component and we don't want to override it
41+
return this.props[method](...[this.props.id, ...arguments])
42+
}.bind(this)
3943
})
4044
}
4145

0 commit comments

Comments
 (0)