From f679f1f73bc047b65e23ebe43e1d076eb33cfd7a Mon Sep 17 00:00:00 2001 From: capt-nemo429 Date: Thu, 6 Jun 2024 17:04:33 -0300 Subject: [PATCH] fix startup wallet connection --- src/stories/walletStore.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/stories/walletStore.ts b/src/stories/walletStore.ts index e4bf1e7..0aeff6f 100644 --- a/src/stories/walletStore.ts +++ b/src/stories/walletStore.ts @@ -10,7 +10,7 @@ import { import { ErgoAddress } from "@fleet-sdk/core"; import { EIP12ErgoAPI, SignedTransaction } from "@nautilus-js/eip12-types"; import { acceptHMRUpdate, defineStore } from "pinia"; -import { computed, nextTick, onBeforeMount, onUnmounted, ref, watch } from "vue"; +import { computed, onBeforeMount, onUnmounted, ref, watch } from "vue"; import { useChainStore } from "./chainStore"; import { ERG_TOKEN_ID } from "@/constants"; import { AssetInfo } from "@/types"; @@ -67,10 +67,7 @@ export const useWalletStore = defineStore("wallet", () => { // hooks onBeforeMount(async () => { addEventListener(WALLET_INJECTED_EVENT, lookupWallets); - - nextTick(() => { - lookupWallets(); - }); + lookupWallets(); }); onUnmounted(() => removeEventListener(WALLET_INJECTED_EVENT, lookupWallets)); @@ -80,9 +77,7 @@ export const useWalletStore = defineStore("wallet", () => { Object.keys(ergoConnector).map((key) => (_wallets.value[key] = true)); const walletId = localStorage.getItem("connectedWallet"); - if (walletId) { - await connect(walletId); - } + if (walletId) await connect(walletId); } // actions