Move redirect to useEffect

[MAILPOET-5833]
This commit is contained in:
Jan Jakes
2024-02-01 08:34:09 +01:00
committed by Aschepikov
parent f24184fe16
commit 7bfcf4bd67

View File

@@ -115,22 +115,25 @@ function Editor(): JSX.Element {
if (!isBooting) {
return;
}
if (automation.status === 'trash') {
window.location.href = addQueryArgs(MailPoet.urls.automationListing, {
notice: LISTING_NOTICES.automationHadBeenDeleted,
'notice-args': [automation.name],
});
}
updatingActiveAutomationNotPossible();
setIsBooting(false);
}, [isBooting]);
}, [automation.name, automation.status, isBooting]);
if (automation.status === 'trash') {
return null;
}
const className = classnames('interface-interface-skeleton', {
'is-sidebar-opened': isSidebarOpened,
'show-icon-labels': showIconLabels,
});
if (automation.status === 'trash') {
window.location.href = addQueryArgs(MailPoet.urls.automationListing, {
notice: LISTING_NOTICES.automationHadBeenDeleted,
'notice-args': [automation.name],
});
return null;
}
return (
<ShortcutProvider>
<SlotFillProvider>