mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-27 09:03:12 +00:00
Fix not being able to directly switch between list timelines in web UI (#10973)
This commit is contained in:
parent
2657765d2a
commit
5bfd802c57
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue