diff --git a/app/javascript/editor/editor.ts b/app/javascript/editor/editor.ts index b509be7..3d344a8 100644 --- a/app/javascript/editor/editor.ts +++ b/app/javascript/editor/editor.ts @@ -278,19 +278,19 @@ function setupEditor (editorEl: HTMLElement): void { } document.addEventListener("turbolinks:load", () => { - const flash = document.querySelector('.js-flash') + const flash = document.querySelector('.js-flash') - if (flash) { - const keys = JSON.parse(flash.dataset.keys || '[]') + if (flash) { + const keys = JSON.parse(flash.dataset.keys || '[]') - switch (flash.dataset.target) { - case 'editor': - switch (flash.dataset.action) { - case 'forget-content': - keys.forEach(forgetContent) - } - } - } + switch (flash.dataset.target) { + case 'editor': + switch (flash.dataset.action) { + case 'forget-content': + keys.forEach(forgetContent) + } + } + } for (const editorEl of document.querySelectorAll('.editor[data-editor]')) { try {