Quellcode durchsuchen

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

master^2
Eugen Rochko vor 5 Jahren
committed by GitHub
Ursprung
Commit
5bfd802c57
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden GPG-Schlüssel-ID: 4AEE18F83AFDEB23
1 geänderte Dateien mit 17 neuen und 0 gelöschten Zeilen
  1. +17
    -0
      app/javascript/mastodon/features/list_timeline/index.js

+ 17
- 0
app/javascript/mastodon/features/list_timeline/index.js Datei anzeigen

@@ -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();


Laden…
Abbrechen
Speichern