Skip to content

Commit

Permalink
fix startup wallet connection
Browse files Browse the repository at this point in the history
  • Loading branch information
capt-nemo429 committed Jun 6, 2024
1 parent 190e7e1 commit f679f1f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/stories/walletStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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));
Expand All @@ -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
Expand Down

0 comments on commit f679f1f

Please sign in to comment.