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 { Awareness } from 'y-protocols/awareness'
|
||||||
import { WebrtcProvider } from 'y-webrtc'
|
import { WebrtcProvider } from 'y-webrtc'
|
||||||
import { Doc, XmlFragment } from 'yjs'
|
import { Doc, XmlFragment } from 'yjs'
|
||||||
import type { Reaction } from '../../../graphql/types.gen'
|
// import type { Reaction } from '../../../graphql/types.gen'
|
||||||
import { setReactions } from '../../../stores/editor'
|
// import { setReactions } from '../../../stores/editor'
|
||||||
|
|
||||||
export const roomConnect = (room: string, username = '', keyname = 'collab'): [XmlFragment, WebrtcProvider] => {
|
export const roomConnect = (room: string, username = '', keyname = 'collab'): [XmlFragment, WebrtcProvider] => {
|
||||||
const ydoc = new Doc()
|
const ydoc = new Doc()
|
||||||
const yarr = ydoc.getArray(keyname + '-reactions')
|
// const yarr = ydoc.getArray(keyname + '-reactions')
|
||||||
|
|
||||||
// TODO: use reactions
|
// TODO: use reactions
|
||||||
yarr.observeDeep(() => {
|
// yarr.observeDeep(() => {
|
||||||
console.debug('[p2p] yarray updated', yarr.toArray())
|
// console.debug('[p2p] yarray updated', yarr.toArray())
|
||||||
setReactions(yarr.toArray() as Reaction[])
|
// setReactions(yarr.toArray() as Reaction[])
|
||||||
})
|
// })
|
||||||
|
|
||||||
const yXmlFragment = ydoc.getXmlFragment(keyname)
|
const yXmlFragment = ydoc.getXmlFragment(keyname)
|
||||||
const webrtcOptions = {
|
const webrtcOptions = {
|
||||||
awareness: new Awareness(ydoc),
|
awareness: new Awareness(ydoc),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user