Client:Pages:DeleteData: fix page crush

This commit is contained in:
Timofey Boyko 2024-02-12 12:18:01 +03:00
parent 2471ec04fb
commit c71248484e
2 changed files with 6 additions and 3 deletions

View File

@ -49,7 +49,7 @@ const PortalDeletion = (props) => {
try {
await sendDeletePortalEmail();
toastr.success(
t("PortalDeletionEmailSended", { ownerEmail: owner.email })
t("PortalDeletionEmailSended", { ownerEmail: owner.email }),
);
} catch (error) {
toastr.error(error);
@ -62,7 +62,7 @@ const PortalDeletion = (props) => {
};
const notActivatedEmail =
owner.activationStatus === EmployeeActivationStatus.NotActivated;
owner?.activationStatus === EmployeeActivationStatus.NotActivated;
return (
<MainContainer>
@ -108,6 +108,8 @@ export default inject(({ settingsStore, userStore }) => {
const { getPortalOwner, owner, currentColorScheme } = settingsStore;
const { sendActivationLink } = userStore;
console.log(owner);
return {
getPortalOwner,
owner,
@ -115,5 +117,5 @@ export default inject(({ settingsStore, userStore }) => {
sendActivationLink,
};
})(
withTranslation(["Settings", "MainBar", "People", "Common"])(PortalDeletion)
withTranslation(["Settings", "MainBar", "People", "Common"])(PortalDeletion),
);

View File

@ -749,6 +749,7 @@ class SettingsStore {
getPortalOwner = async () => {
const owner = await api.people.getUserById(this.ownerId);
this.setPortalOwner(owner);
return owner;
};