diff options
author | Reverite <github@reverite.sh> | 2019-06-09 16:54:21 -0700 |
---|---|---|
committer | Reverite <github@reverite.sh> | 2019-06-09 16:54:21 -0700 |
commit | 3614718bc91f90a6dc19dd80ecf3bc191283c24e (patch) | |
tree | ad35f4dbe92fdbc3f95881d6be3d4f9b29d4a704 /app/javascript/flavours/glitch/features/list_timeline | |
parent | 846a09a7435fb9eb435e9950175ee0e696ed4909 (diff) | |
parent | e16c8fbc7a2b5a866960a87bc8c950ad0d38f61b (diff) |
Merge branch 'glitch' into production
Diffstat (limited to 'app/javascript/flavours/glitch/features/list_timeline')
-rw-r--r-- | app/javascript/flavours/glitch/features/list_timeline/index.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/features/list_timeline/index.js b/app/javascript/flavours/glitch/features/list_timeline/index.js index ef829b937..0405073c5 100644 --- a/app/javascript/flavours/glitch/features/list_timeline/index.js +++ b/app/javascript/flavours/glitch/features/list_timeline/index.js @@ -75,6 +75,23 @@ export default 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(); |