diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-06-06 13:04:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-06 13:04:49 +0200 |
commit | 5bfd802c571a2793bb59ba4540407a6147e82f88 (patch) | |
tree | 4998481ddd167f0f3635dce800f3c2702b9bdfff /app | |
parent | 2657765d2a6804f34ce65bfdab7ec96f07d99732 (diff) |
Fix not being able to directly switch between list timelines in web UI (#10973)
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/mastodon/features/list_timeline/index.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/javascript/mastodon/features/list_timeline/index.js b/app/javascript/mastodon/features/list_timeline/index.js index b6722e91a..ad7d16f95 100644 --- a/app/javascript/mastodon/features/list_timeline/index.js +++ b/app/javascript/mastodon/features/list_timeline/index.js @@ -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(); |