feat: Seamless Edit (#2701)

* feat: Remove explicit edit

* Restore revision remains disabled for now

* Bump RME, better differentiation of focused state

* fix: Star not visible in edit mode

* remove stray log

* fix: Occassional user context not available in collaborative persistence
This commit is contained in:
Tom Moor
2021-11-08 20:52:17 -08:00
committed by GitHub
parent 37be7f99c4
commit c597f2d9a2
13 changed files with 302 additions and 207 deletions

View File

@@ -13,7 +13,7 @@ export default async function documentUpdater({
}: {
documentId: string,
ydoc: Y.Doc,
userId: string,
userId?: string,
}) {
const document = await Document.findByPk(documentId);
const state = Y.encodeStateAsUpdate(ydoc);
@@ -38,7 +38,8 @@ export default async function documentUpdater({
text,
state: Buffer.from(state),
updatedAt: isUnchanged ? document.updatedAt : new Date(),
lastModifiedById: isUnchanged ? document.lastModifiedById : userId,
lastModifiedById:
isUnchanged || !userId ? document.lastModifiedById : userId,
collaboratorIds,
},
{