Skip to content

Commit

Permalink
Fix not being able to directly switch between list timelines in web UI (
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron authored and multiple creatures committed Nov 19, 2019
1 parent df2518d commit 68621fa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/javascript/mastodon/features/list_timeline/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,23 @@ class ListTimeline extends React.PureComponent {
this.disconnect = dispatch(connectListStream(id));
}

componentWillReceiveProps (nextProps) {
const { dispatch } = this.props;
const { id } = nextProps.params;

if (id !== this.props.params.id) {
if (this.disconnect) {
this.disconnect();
this.disconnect = null;
}

dispatch(fetchList(id));
dispatch(expandListTimeline(id));

this.disconnect = dispatch(connectListStream(id));
}
}

componentWillUnmount () {
if (this.disconnect) {
this.disconnect();
Expand Down

0 comments on commit 68621fa

Please sign in to comment.