Skip to content

Commit

Permalink
Deep compare tags for hashtag column reload (#9297)
Browse files Browse the repository at this point in the history
* Deep compare tags for hashtag column reload

* Don't use global lodash
  • Loading branch information
gdpelican authored and Gargron committed Nov 17, 2018
1 parent 9311430 commit 4fdefff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/javascript/mastodon/features/hashtag_timeline/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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}`));
Expand Down

0 comments on commit 4fdefff

Please sign in to comment.