Wait for readyness before sending msg

This commit is contained in:
Daniel Lugo 2021-09-16 17:08:17 -04:00
parent ed3bab0f8e
commit 5d8f9054f8

View file

@ -428,7 +428,9 @@ function createReplica(path, afterMap = false) {
path, path,
type: 'map.on' type: 'map.on'
} }
isReady().then(() => {
currentGun.send(msg) currentGun.send(msg)
})
} else { } else {
// eslint-disable-next-line no-multi-assign // eslint-disable-next-line no-multi-assign
const listeners = const listeners =
@ -441,7 +443,9 @@ function createReplica(path, afterMap = false) {
path, path,
type: 'on' type: 'on'
} }
isReady().then(() => {
currentGun.send(msg) currentGun.send(msg)
})
} }
return this return this