X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a6633642232efd164d4708967ab59e498fbff896..refs/pull/3039/head:/resources/js/components/page-editor.js diff --git a/resources/js/components/page-editor.js b/resources/js/components/page-editor.js index f66e23b19..5f35e6499 100644 --- a/resources/js/components/page-editor.js +++ b/resources/js/components/page-editor.js @@ -40,6 +40,7 @@ class PageEditor { frequency: 30000, last: 0, }; + this.shownWarningsCache = new Set(); if (this.pageId !== 0 && this.draftsEnabled) { window.setTimeout(() => { @@ -119,6 +120,10 @@ class PageEditor { } this.draftNotifyChange(`${resp.data.message} ${Dates.utcTimeStampToLocalTime(resp.data.timestamp)}`); this.autoSave.last = Date.now(); + if (resp.data.warning && !this.shownWarningsCache.has(resp.data.warning)) { + window.$events.emit('warning', resp.data.warning); + this.shownWarningsCache.add(resp.data.warning); + } } catch (err) { // Save the editor content in LocalStorage as a last resort, just in case. try {