Web: People: Profile: fix memory leak

This commit is contained in:
Viktor Fomin 2022-05-13 18:59:31 +03:00
parent e39da2cbaa
commit 11243c773b

View File

@ -150,26 +150,15 @@ class SectionBodyContent extends React.PureComponent {
tfa: null,
};
}
async componentDidMount() {
fetchData = async () => {
const {
//cultures,
//getPortalCultures,
//profile,
//viewer,
isSelf,
setProviders,
getTfaType,
getBackupCodes,
setBackupCodes,
} = this.props;
//const isSelf = isMe(viewer, profile.userName);
//if (isSelf && !cultures.length) {
//getPortalCultures();
//}
if (!isSelf) return;
try {
await getAuthProviders().then((providers) => {
setProviders(providers);
@ -185,9 +174,32 @@ class SectionBodyContent extends React.PureComponent {
const codes = await getBackupCodes();
setBackupCodes(codes);
}
};
componentDidMount() {
const {
//cultures,
//getPortalCultures,
//profile,
//viewer,
isSelf,
} = this.props;
//const isSelf = isMe(viewer, profile.userName);
//if (isSelf && !cultures.length) {
//getPortalCultures();
//}
if (!isSelf) return;
this.fetchData();
window.loginCallback = this.loginCallback;
}
componentWillUnmount() {
window.loginCallback = null;
}
onEditSubscriptionsClick = () => console.log("Edit subscriptions onClick()");
onEditProfileClick = () => {