Skip to content

Commit 161dbd3

Browse files
Gargronhiyuki2578
authored andcommitted
Fix not being able to directly switch between list timelines in web UI (mastodon#10973)
1 parent c7c948f commit 161dbd3

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

  • app/javascript/mastodon/features/list_timeline

app/javascript/mastodon/features/list_timeline/index.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,23 @@ class ListTimeline extends React.PureComponent {
7575
this.disconnect = dispatch(connectListStream(id));
7676
}
7777

78+
componentWillReceiveProps (nextProps) {
79+
const { dispatch } = this.props;
80+
const { id } = nextProps.params;
81+
82+
if (id !== this.props.params.id) {
83+
if (this.disconnect) {
84+
this.disconnect();
85+
this.disconnect = null;
86+
}
87+
88+
dispatch(fetchList(id));
89+
dispatch(expandListTimeline(id));
90+
91+
this.disconnect = dispatch(connectListStream(id));
92+
}
93+
}
94+
7895
componentWillUnmount () {
7996
if (this.disconnect) {
8097
this.disconnect();

0 commit comments

Comments
 (0)