2
0
Yuki Takei 1 жил өмнө
parent
commit
3259c32dfd

+ 4 - 2
apps/app/src/server/service/yjs.ts

@@ -141,16 +141,18 @@ class YjsService {
 
     if (diff.reduce((prev, curr) => prev + curr, 0) > 0) {
       this.mdb.storeUpdate(pageId, diff);
+      this.mdb.setMeta(pageId, 'updatedAt', Date.now());
     }
 
     Y.applyUpdate(currentYdoc, Y.encodeStateAsUpdate(persistedYdoc));
 
     currentYdoc.on('update', async(update) => {
-      await this.mdb.storeUpdate(pageId, update);
+      this.mdb.storeUpdate(pageId, update);
+      this.mdb.setMeta(pageId, 'updatedAt', Date.now());
     });
 
     currentYdoc.on('destroy', async() => {
-      await this.mdb.flushDocument(pageId);
+      this.mdb.flushDocument(pageId);
     });
 
     persistedYdoc.destroy();