Skip to content

Commit

Permalink
fix(Realtime): Complexifies the emission of the event
Browse files Browse the repository at this point in the history
  • Loading branch information
kosssi committed May 7, 2019
1 parent 0bb646e commit abd545b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/cozy-realtime/src/Socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class Socket {
})

this._webSocket.send(message)
this.emit('subscribe')
this.emit(`subscribe_${type}_${id}`)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/cozy-realtime/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class CozyRealtime {
this.on(key, handler)
this._numberOfHandlers++

this._socket.once('subscribe', resolve)
this._socket.once(`subscribe_${config.type}_${config.id}`, resolve)
this._socket.subscribe(config.type, config.id)
})
}
Expand Down

0 comments on commit abd545b

Please sign in to comment.