]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Deep compare tags for hashtag column reload
authorThibaut Girka <thib@sitedethib.com>
Tue, 18 Dec 2018 17:05:29 +0000 (18:05 +0100)
committerThibG <thib@sitedethib.com>
Fri, 21 Dec 2018 18:54:54 +0000 (19:54 +0100)
Port 4fdefffb9906ffc3e5fde7af652674bebffd6e15 to glitch-soc

app/javascript/flavours/glitch/features/hashtag_timeline/index.js

index 4455f89577b1820c46ccace47b34bc22d512dc8f..49893dde8464b4c61bc7446ffe86ea76a429e62f 100644 (file)
@@ -9,6 +9,7 @@ import { expandHashtagTimeline, clearTimeline } from 'flavours/glitch/actions/ti
 import { addColumn, removeColumn, moveColumn } from 'flavours/glitch/actions/columns';
 import { FormattedMessage } from 'react-intl';
 import { connectHashtagStream } from 'flavours/glitch/actions/streaming';
+import { isEqual } from 'lodash';
 
 const mapStateToProps = (state, props) => ({
   hasUnread: state.getIn(['timelines', `hashtag:${props.params.id}`, 'unread']) > 0,
@@ -99,7 +100,7 @@ export default 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}`));