diff --git a/src/components/Editor.vue b/src/components/Editor.vue index 23dd275ee1d..74ea522670e 100644 --- a/src/components/Editor.vue +++ b/src/components/Editor.vue @@ -655,6 +655,10 @@ export default { this.emit('delete-image-node', imageUrl) }, + async save() { + await this.$syncService.save() + }, + async close() { if (this.currentSession && this.$syncService) { try { diff --git a/src/editor.js b/src/editor.js index 1294fee980d..001675d6656 100644 --- a/src/editor.js +++ b/src/editor.js @@ -81,6 +81,10 @@ class TextEditorEmbed { return this } + async save() { + return this.#vm.$children[0].save?.() + } + setShowOutline(value) { this.#vm.$set(this.#data, 'showOutlineOutside', value) return this diff --git a/src/services/SyncService.js b/src/services/SyncService.js index 8197ec8c2e9..bfa4c8f3c34 100644 --- a/src/services/SyncService.js +++ b/src/services/SyncService.js @@ -268,6 +268,7 @@ class SyncService { this.autosave.clear() } catch (e) { logger.error('Failed to save document.', { error: e }) + throw e } }