mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-23 09:51:13 +01:00
Fix not being able to directly switch between list timelines in web UI (#10973)
This commit is contained in:
parent
2657765d2a
commit
5bfd802c57
1 changed files with 17 additions and 0 deletions
|
@ -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