From 948b41ea9fda0928f852aa2a6d6528cb7bf31e3c Mon Sep 17 00:00:00 2001 From: Josh Stevens Date: Mon, 14 Sep 2020 18:04:29 +0100 Subject: [PATCH] fix race condition --- src/components/Wallet-Leader.vue | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/Wallet-Leader.vue b/src/components/Wallet-Leader.vue index 096f1f8..38a2c08 100644 --- a/src/components/Wallet-Leader.vue +++ b/src/components/Wallet-Leader.vue @@ -7,7 +7,7 @@ id="funwallet-iframe" is-fun-wallet="true" is-leader="true" - :onload="leaderLoaded()" + @load="leaderLoaded" frameborder="0" > @@ -26,11 +26,8 @@ export default { }, methods: { leaderLoaded() { - // fix this race condition - setTimeout(() => { - window.funwallet.sdk.init(); - this.registerWalletEventsCallback(); - }, 2000); + window.funwallet.sdk.init(); + this.registerWalletEventsCallback(); }, }, };