Skip to content

Commit ac6c23b

Browse files
committed
fix(editorApi): expose save function
Signed-off-by: Jonas <[email protected]>
1 parent 02f6461 commit ac6c23b

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/components/Editor.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,10 @@ export default {
655655
this.emit('delete-image-node', imageUrl)
656656
},
657657
658+
async save() {
659+
await this.$syncService.save()
660+
},
661+
658662
async close() {
659663
if (this.currentSession && this.$syncService) {
660664
try {

src/editor.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ class TextEditorEmbed {
8181
return this
8282
}
8383

84+
async save() {
85+
return this.#vm.$children[0].save?.()
86+
}
87+
8488
setShowOutline(value) {
8589
this.#vm.$set(this.#data, 'showOutlineOutside', value)
8690
return this

src/services/SyncService.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ class SyncService {
268268
this.autosave.clear()
269269
} catch (e) {
270270
logger.error('Failed to save document.', { error: e })
271+
throw e
271272
}
272273
}
273274

0 commit comments

Comments
 (0)