Skip to content

Commit

Permalink
fix: Use setEditable instead of options to propagate update of the state
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Aug 7, 2023
1 parent 617278b commit be8d7e8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/BaseReader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default {
created() {
this.$editor = this.createEditor()
this.$editor.setOptions({ editable: false })
this.$editor.setEditable(false)
},
beforeDestroy() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/CollisionResolveDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ export default {
resolveThisVersion() {
this.clicked = true
this.$syncService.forceSave().then(() => this.$syncService.syncUp())
this.$editor.setOptions({ editable: !this.readOnly })
this.$editor.setEditable(!this.readOnly)
},
resolveServerVersion() {
const { outsideChange } = this.syncError.data
this.clicked = true
this.$editor.setOptions({ editable: !this.readOnly })
this.$editor.setEditable(!this.readOnly)
this.setContent(outsideChange, { isRich: this.$isRichEditor })
this.$syncService.forceSave().then(() => this.$syncService.syncUp())
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ export default {
this.document = document
this.readOnly = document.readOnly
if (this.$editor) {
this.$editor.setOptions({ editable: !this.readOnly })
this.$editor.setEditable(!this.readOnly)
}
this.lock = this.$syncService.lock
localStorage.setItem('nick', this.currentSession.guestName)
Expand Down Expand Up @@ -547,7 +547,7 @@ export default {
this.document = document
this.syncError = null
this.$editor.setOptions({ editable: !this.readOnly })
this.$editor.setEditable(!this.readOnly)
},
onSync({ steps, document }) {
Expand Down Expand Up @@ -616,7 +616,7 @@ export default {
this.$syncService.close()
this.idle = true
this.readOnly = true
this.$editor.setOptions({ editable: !this.readOnly })
this.$editor.setEditable(!this.readOnly)
this.$nextTick(() => {
this.emit('sync-service:idle')
Expand Down
2 changes: 1 addition & 1 deletion src/components/Editor/MarkdownContentEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default {
created() {
this.$editor = this.createEditor()
this.$editor.setOptions({ editable: !this.readOnly })
this.$editor.setEditable(!this.readOnly)
},
beforeDestroy() {
Expand Down

0 comments on commit be8d7e8

Please sign in to comment.