Skip to content

Commit

Permalink
fix too many changes added
Browse files Browse the repository at this point in the history
  • Loading branch information
nikgraf committed May 13, 2024
1 parent cda4958 commit 2f96854
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"sql.js": "^1.9.0",
"twrnc": "^3.4.0",
"urql": "^4.0.6",
"xstate": "^5.9.1",
"xstate": "^5.13.0",
"y-protocols": "^1.0.6",
"yjs": "^13.6.11",
"zod": "^3.22.4",
Expand Down
6 changes: 4 additions & 2 deletions packages/secsync/src/useYjsSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ export const useYjsSync = (config: YjsSyncMachineConfig) => {

// only connect the awareness after the document loaded
if (snapshot.context._documentDecryptionState !== "complete") {
return;
return () => {
yDoc.off("updateV2", onUpdate);
};
}

const onAwarenessUpdate = ({ added, updated, removed }: any) => {
Expand Down Expand Up @@ -144,7 +146,7 @@ export const useYjsSync = (config: YjsSyncMachineConfig) => {
"hook unmount"
);
yAwarenessRef.current.off("update", onAwarenessUpdate);
yDoc.off("update", onUpdate);
yDoc.off("updateV2", onUpdate);
};
// causes issues if ran multiple times e.g. awareness sharing to not work anymore
}, [snapshot.context._documentDecryptionState]);
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18318,10 +18318,10 @@ xss@^1.0.8:
commander "^2.20.3"
cssfilter "0.0.10"

xstate@^5.9.1:
version "5.9.1"
resolved "https://registry.yarnpkg.com/xstate/-/xstate-5.9.1.tgz#1f167fae423cadd362762e2ff697d84fd774979c"
integrity sha512-85edx7iMqRJSRlEPevDwc98EWDYUlT5zEQ54AXuRVR+G76gFbcVTAUdtAeqOVxy8zYnUr9FBB5114iK6enljjw==
xstate@^5.13.0:
version "5.13.0"
resolved "https://registry.yarnpkg.com/xstate/-/xstate-5.13.0.tgz#7f7092d813a89d94024b083fe23a86b6cf4a323a"
integrity sha512-Z0om784N5u8sAzUvQJBa32jiTCIGGF/2ZsmKkerQEqeeUktAeOMK20FIHFUMywC4GcAkNksSvaeX7lwoRNXPEQ==

xtend@^4.0.0, xtend@^4.0.2, xtend@~4.0.1:
version "4.0.2"
Expand Down

0 comments on commit 2f96854

Please sign in to comment.