In Trellis, we're doing this to update our user's peer name:
updatePeerName(value) {
aMPL.config.name = value
localStorage.setItem("peerName", value)
// Force network reconnect
this.props.store.dispatch({
type: "OPEN_DOCUMENT",
file: this.props.store.save()
})
}
It sets the shared config on aMPL, and then re-opens the current document as a hacky way of getting the network to reconnect and update all of our listeners in the omniview sidebar. It works for now, but something breaks if you change your peer name too many times too quickly.
In Trellis, we're doing this to update our user's peer name:
It sets the shared config on aMPL, and then re-opens the current document as a hacky way of getting the network to reconnect and update all of our listeners in the omniview sidebar. It works for now, but something breaks if you change your peer name too many times too quickly.