added safety to setUserId (when called twice)
This commit is contained in:
parent
98d87cb26d
commit
bdf290adb2
@ -144,3 +144,4 @@ Yjs is licensed under the [MIT License](./LICENSE.txt).
|
||||
|
||||
[ShareJs]: https://github.com/share/ShareJS
|
||||
[OpenCoweb]: https://github.com/opencoweb/coweb/wiki
|
||||
|
||||
|
2
dist
2
dist
@ -1 +1 @@
|
||||
Subproject commit 8ba1e4ce27a75bb025a5478723ea57f7f437ccf0
|
||||
Subproject commit ab6a193ec6ec799bdb77fa23eeec1f05d5b910d6
|
@ -63,8 +63,12 @@ module.exports = function (Y/* :any */) {
|
||||
return this.y.db.stopGarbageCollector()
|
||||
}
|
||||
setUserId (userId) {
|
||||
this.userId = userId
|
||||
return this.y.db.setUserId(userId)
|
||||
if (this.userId == null) {
|
||||
this.userId = userId
|
||||
return this.y.db.setUserId(userId)
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
onUserEvent (f) {
|
||||
this.userEventListeners.push(f)
|
||||
|
Loading…
x
Reference in New Issue
Block a user