Skip to content

Commit

Permalink
Debug broken autosave
Browse files Browse the repository at this point in the history
Refs #320
  • Loading branch information
carlobeltrame committed Apr 18, 2024
1 parent 2e41608 commit 8f08b27
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,5 @@ if (process.env.MIX_SENTRY_VUE_DSN && process.env.MIX_SENTRY_VUE_DSN !== 'null')
logErrors: true,
})
}

console.log('hello world!')
10 changes: 10 additions & 0 deletions resources/js/components/AutoSave.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ export default {
window.open(this.routeUri('refreshCsrf'))
},
onInput () {
console.log('AutoSave input')
this.dirty = true
this.debouncedAutosave()
},
autosave () {
console.log('autosaving', this.form())
this.saving = true
this.offline = false
this.loggedOut = false
Expand All @@ -71,6 +73,14 @@ export default {
}
})
}
},
watch: {
dirty: {
handler () {
console.log('dirty:', this.dirty)
},
immediate: true,
}
}
}
</script>
2 changes: 2 additions & 0 deletions resources/js/components/feedback/FeedbackEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ export default {
let creating = true
editor.on('update', ({editor, transaction}) => {
this.currentValue = editor.getJSON()
console.log('FeedbackEditor input', this.currentValue)
this.$emit('input', this.currentValue)
// onUpdate is also called while creating the editor, so filter that call out
if (!this.isRemoteChange(transaction) && !creating) {
console.log('FeedbackEditor localinput', this.currentValue)
this.$emit('localinput', this.currentValue)
}
creating = false
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/feedback/FormFeedbackContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export default {
},
methods: {
onLocalInput(...args) {
console.log('FormFeedbackContent onLocalInput', ...args)
this.error = false
this.$refs.autosave.onInput(...args)
}
Expand Down

0 comments on commit 8f08b27

Please sign in to comment.