From 1d7a71ae3acb82bd9170983ea51be1e84ba0661f Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Wed, 19 Oct 2022 19:35:24 +0300 Subject: [PATCH] no reactions in p2p --- src/components/Editor/prosemirror/p2p.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/components/Editor/prosemirror/p2p.ts b/src/components/Editor/prosemirror/p2p.ts index e878586a..09cdfe81 100644 --- a/src/components/Editor/prosemirror/p2p.ts +++ b/src/components/Editor/prosemirror/p2p.ts @@ -2,19 +2,17 @@ import { uniqueNamesGenerator, adjectives, animals } from 'unique-names-generato import { Awareness } from 'y-protocols/awareness' import { WebrtcProvider } from 'y-webrtc' import { Doc, XmlFragment } from 'yjs' -import type { Reaction } from '../../../graphql/types.gen' -import { setReactions } from '../../../stores/editor' +// import type { Reaction } from '../../../graphql/types.gen' +// import { setReactions } from '../../../stores/editor' export const roomConnect = (room: string, username = '', keyname = 'collab'): [XmlFragment, WebrtcProvider] => { const ydoc = new Doc() - const yarr = ydoc.getArray(keyname + '-reactions') - + // const yarr = ydoc.getArray(keyname + '-reactions') // TODO: use reactions - yarr.observeDeep(() => { - console.debug('[p2p] yarray updated', yarr.toArray()) - setReactions(yarr.toArray() as Reaction[]) - }) - + // yarr.observeDeep(() => { + // console.debug('[p2p] yarray updated', yarr.toArray()) + // setReactions(yarr.toArray() as Reaction[]) + // }) const yXmlFragment = ydoc.getXmlFragment(keyname) const webrtcOptions = { awareness: new Awareness(ydoc),