]> cat aescling's git repositories - mastodon.git/commitdiff
Deep compare tags for hashtag column reload (#9297)
authorJames Kiesel <james.kiesel@gmail.com>
Sat, 17 Nov 2018 10:07:48 +0000 (23:07 +1300)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 17 Nov 2018 10:07:48 +0000 (11:07 +0100)
* Deep compare tags for hashtag column reload

* Don't use global lodash

app/javascript/mastodon/features/hashtag_timeline/index.js

index 86658cb66ef81af5fac5bf3c73df6805cbc0c83f..d7722dccec4bfe05ff875ded0d4ed52e9a4fd47f 100644 (file)
@@ -9,6 +9,7 @@ import { expandHashtagTimeline, clearTimeline } from '../../actions/timelines';
 import { addColumn, removeColumn, moveColumn } from '../../actions/columns';
 import { FormattedMessage } from 'react-intl';
 import { connectHashtagStream } from '../../actions/streaming';
+import { isEqual } from 'lodash';
 
 const mapStateToProps = (state, props) => ({
   hasUnread: state.getIn(['timelines', `hashtag:${props.params.id}`, 'unread']) > 0,
@@ -100,7 +101,7 @@ class HashtagTimeline extends React.PureComponent {
   componentWillReceiveProps (nextProps) {
     const { dispatch, params } = this.props;
     const { id, tags } = nextProps.params;
-    if (id !== params.id || tags !== params.tags) {
+    if (id !== params.id || !isEqual(tags, params.tags)) {
       this._unsubscribe();
       this._subscribe(dispatch, id, tags);
       this.props.dispatch(clearTimeline(`hashtag:${id}`));