fix broadcast channel communication
This commit is contained in:
parent
1a79e429ed
commit
b6f7cd7869
@ -18,6 +18,7 @@
|
||||
"now-start": "npm run websocket-server"
|
||||
},
|
||||
"files": [
|
||||
"build/*",
|
||||
"bindings/*",
|
||||
"docs/*",
|
||||
"examples/*",
|
||||
|
@ -104,8 +104,8 @@ class WebsocketsSharedDocument extends Y.Y {
|
||||
setupWS(this, url)
|
||||
this.on('afterTransaction', broadcastUpdate)
|
||||
this._bcSubscriber = data => {
|
||||
const encoder = readMessage(this, data) // already muxed
|
||||
this.mux(() => {
|
||||
const encoder = readMessage(this, data)
|
||||
if (Y.encoding.length(encoder) > 1) {
|
||||
bc.publish(url, Y.encoding.toBuffer(encoder))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user