Fix react warnings and part of backstage (#4706)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
05783664cd
Коммит
145876681f
@@ -77,16 +77,24 @@ class UserSettingsModal extends React.Component {
|
||||
};
|
||||
|
||||
this.requireConfirm = false;
|
||||
this.mounted = false;
|
||||
}
|
||||
|
||||
onUserChanged() {
|
||||
this.setState({currentUser: UserStore.getCurrentUser()});
|
||||
if (this.mounted) {
|
||||
this.setState({currentUser: UserStore.getCurrentUser()});
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.mounted = true;
|
||||
UserStore.addChangeListener(this.onUserChanged);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.mounted = false;
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
UserStore.removeChangeListener(this.onUserChanged);
|
||||
if (!Utils.isMobile()) {
|
||||
|
||||
Ссылка в новой задаче
Block a user