partial mods to replace deprecated componentWillReceiveProps

merge-requests/82/merge
crockwave 2020-06-22 20:26:20 -05:00
rodzic 8a43cb3709
commit 3d29f7b6e2
12 zmienionych plików z 12 dodań i 12 usunięć

Wyświetl plik

@ -137,7 +137,7 @@ class RelativeTimestamp extends React.Component {
this.state.now !== nextState.now;
}
componentWillReceiveProps(nextProps) {
componentDidUpdate(nextProps) {
if (this.props.timestamp !== nextProps.timestamp) {
this.setState({ now: Date.now() });
}

Wyświetl plik

@ -97,7 +97,7 @@ class AccountGallery extends ImmutablePureComponent {
}
}
componentWillReceiveProps(nextProps) {
componentDidUpdate(nextProps) {
if (nextProps.accountId && nextProps.accountId !== -1 && (nextProps.accountId !== this.props.accountId && nextProps.accountId)) {
this.props.dispatch(fetchAccount(nextProps.params.accountId));
this.props.dispatch(expandAccountMediaTimeline(nextProps.accountId));

Wyświetl plik

@ -81,7 +81,7 @@ class AccountTimeline extends ImmutablePureComponent {
}
}
componentWillReceiveProps(nextProps) {
componentDidUpdate(nextProps) {
const { me } = nextProps;
if (nextProps.accountId && nextProps.accountId !== -1 && (nextProps.accountId !== this.props.accountId && nextProps.accountId) || nextProps.withReplies !== this.props.withReplies) {
this.props.dispatch(fetchAccount(nextProps.accountId));

Wyświetl plik

@ -56,7 +56,7 @@ class ModifierPickerMenu extends React.PureComponent {
this.props.onSelect(e.currentTarget.getAttribute('data-index') * 1);
}
componentWillReceiveProps(nextProps) {
componentDidUpdate(nextProps) {
if (nextProps.active) {
this.attachListeners();
} else {

Wyświetl plik

@ -27,7 +27,7 @@ class Favourites extends ImmutablePureComponent {
this.props.dispatch(fetchFavourites(this.props.params.statusId));
}
componentWillReceiveProps(nextProps) {
componentDidUpdate(nextProps) {
if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) {
this.props.dispatch(fetchFavourites(nextProps.params.statusId));
}

Wyświetl plik

@ -69,7 +69,7 @@ class Followers extends ImmutablePureComponent {
}
}
componentWillReceiveProps(nextProps) {
componentDidUpdate(nextProps) {
if (nextProps.accountId && nextProps.accountId !== -1 && (nextProps.accountId !== this.props.accountId && nextProps.accountId)) {
this.props.dispatch(fetchAccount(nextProps.accountId));
this.props.dispatch(fetchFollowers(nextProps.accountId));

Wyświetl plik

@ -69,7 +69,7 @@ class Following extends ImmutablePureComponent {
}
}
componentWillReceiveProps(nextProps) {
componentDidUpdate(nextProps) {
if (nextProps.accountId && nextProps.accountId !== -1 && (nextProps.accountId !== this.props.accountId && nextProps.accountId)) {
this.props.dispatch(fetchAccount(nextProps.accountId));
this.props.dispatch(fetchFollowing(nextProps.accountId));

Wyświetl plik

@ -61,7 +61,7 @@ class Edit extends React.PureComponent {
}
}
componentWillReceiveProps(nextProps) {
componentDidUpdate(nextProps) {
if (!this.props.group && nextProps.group) {
this.props.setUp(nextProps.group);
}

Wyświetl plik

@ -36,7 +36,7 @@ class GroupMembers extends ImmutablePureComponent {
this.props.dispatch(fetchMembers(id));
}
componentWillReceiveProps(nextProps) {
componentDidUpdate(nextProps) {
if (nextProps.params.id !== this.props.params.id) {
this.props.dispatch(fetchMembers(nextProps.params.id));
}

Wyświetl plik

@ -43,7 +43,7 @@ class GroupRemovedAccounts extends ImmutablePureComponent {
this.props.dispatch(fetchRemovedAccounts(id));
}
componentWillReceiveProps(nextProps) {
componentDidUpdate(nextProps) {
if (nextProps.params.id !== this.props.params.id) {
this.props.dispatch(fetchRemovedAccounts(nextProps.params.id));
}

Wyświetl plik

@ -81,7 +81,7 @@ class HashtagTimeline extends React.PureComponent {
dispatch(expandHashtagTimeline(id, { tags }));
}
componentWillReceiveProps(nextProps) {
componentDidUpdate(nextProps) {
const { dispatch, params } = this.props;
const { id, tags } = nextProps.params;

Wyświetl plik

@ -50,7 +50,7 @@ class ListTimeline extends React.PureComponent {
this.handleDisconnect();
}
componentWillReceiveProps(nextProps) {
componentDidUpdate(nextProps) {
if (nextProps.params.id !== this.props.params.id) {
this.handleDisconnect();
this.handleConnect(nextProps.params.id);