Move redirect to useEffect
[MAILPOET-5833]
This commit is contained in:
@@ -115,22 +115,25 @@ function Editor(): JSX.Element {
|
|||||||
if (!isBooting) {
|
if (!isBooting) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (automation.status === 'trash') {
|
||||||
|
window.location.href = addQueryArgs(MailPoet.urls.automationListing, {
|
||||||
|
notice: LISTING_NOTICES.automationHadBeenDeleted,
|
||||||
|
'notice-args': [automation.name],
|
||||||
|
});
|
||||||
|
}
|
||||||
updatingActiveAutomationNotPossible();
|
updatingActiveAutomationNotPossible();
|
||||||
setIsBooting(false);
|
setIsBooting(false);
|
||||||
}, [isBooting]);
|
}, [automation.name, automation.status, isBooting]);
|
||||||
|
|
||||||
|
if (automation.status === 'trash') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const className = classnames('interface-interface-skeleton', {
|
const className = classnames('interface-interface-skeleton', {
|
||||||
'is-sidebar-opened': isSidebarOpened,
|
'is-sidebar-opened': isSidebarOpened,
|
||||||
'show-icon-labels': showIconLabels,
|
'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 (
|
return (
|
||||||
<ShortcutProvider>
|
<ShortcutProvider>
|
||||||
<SlotFillProvider>
|
<SlotFillProvider>
|
||||||
|
Reference in New Issue
Block a user