persist document to database after 2 seconds of no updates, initialize with current state when joining genserver

This commit is contained in:
2023-11-24 20:24:40 -05:00
parent 52a7a64d23
commit 1ec5459a79
5 changed files with 50 additions and 12 deletions

View File

@@ -28,6 +28,11 @@ export let TextEditor = {
range && this.quill.setSelection(range.index, range.length);
})
channel.on("saved", () => {
console.log('Saved');
// TODO: Show a saved message
})
this.quill.on('text-change', (delta, oldDelta, source) => {
if (delta == oldDelta) return;
if (source == 'api') {