Skip to content

Commit

Permalink
fix(editorApi): expose save function
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Sep 7, 2023
1 parent 02f6461 commit ac6c23b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/services/SyncService.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ class SyncService {
this.autosave.clear()
} catch (e) {
logger.error('Failed to save document.', { error: e })
throw e
}
}

Expand Down

0 comments on commit ac6c23b

Please sign in to comment.