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 <jus@bitgrid.net>
  • Loading branch information
juliushaertl committed Aug 2, 2023
1 parent c19dc60 commit dc28fcd
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
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
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
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
Expand Up @@ -90,7 +90,7 @@ export default {
created() {
this.$editor = this.createEditor()
this.$editor.setOptions({ editable: !this.readOnly })
this.$editor.setEditable(!this.readOnlyse)
},
beforeDestroy() {
Expand Down

0 comments on commit dc28fcd

Please sign in to comment.