Browse Source

Fix not being able to directly switch between list timelines in web UI (#10973)

pull/4/head
Eugen Rochko 4 years ago
committed by GitHub
parent
commit
5bfd802c57
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 0 deletions
  1. +17
    -0
      app/javascript/mastodon/features/list_timeline/index.js

+ 17
- 0
app/javascript/mastodon/features/list_timeline/index.js View File

@ -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…
Cancel
Save