Add static fallback link to old editor

[MAILPOET-2549]
This commit is contained in:
Rostislav Wolny
2020-01-21 11:38:22 +01:00
committed by Jack Kitterhing
parent a9f612d57f
commit be0c9a726c
3 changed files with 19 additions and 9 deletions

View File

@ -16,14 +16,20 @@ const App = () => (
);
const appElement = document.querySelector('#mailpoet_form_edit');
const oldEditorLinkElement = document.querySelector('#mailpoet_form_edit_old_editor_fallback_link');
if (appElement) {
initStore();
initBlocks();
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
appElement
);
try {
oldEditorLinkElement.style.display = 'none';
initStore();
initBlocks();
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
appElement
);
} catch (e) {
oldEditorLinkElement.style.display = 'block';
}
}