From 5d8f9054f8549a4744f7fd6caa3503d524a59d39 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Thu, 16 Sep 2021 17:08:17 -0400 Subject: [PATCH] Wait for readyness before sending msg --- utils/GunSmith/GunSmith.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/utils/GunSmith/GunSmith.js b/utils/GunSmith/GunSmith.js index 11186ce5..f7cc8107 100644 --- a/utils/GunSmith/GunSmith.js +++ b/utils/GunSmith/GunSmith.js @@ -428,7 +428,9 @@ function createReplica(path, afterMap = false) { path, type: 'map.on' } - currentGun.send(msg) + isReady().then(() => { + currentGun.send(msg) + }) } else { // eslint-disable-next-line no-multi-assign const listeners = @@ -441,7 +443,9 @@ function createReplica(path, afterMap = false) { path, type: 'on' } - currentGun.send(msg) + isReady().then(() => { + currentGun.send(msg) + }) } return this