no reactions in p2p
This commit is contained in:
parent
634c8ae59c
commit
1d7a71ae3a
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue
Block a user