fix connect wallet issue

This commit is contained in:
liangping 2023-05-21 19:07:30 +08:00
parent 03abd9c75a
commit 94ba4b1668
2 changed files with 9 additions and 8 deletions

View File

@ -1,8 +1,10 @@
<script setup lang="ts">
import { useWalletStore } from '@/stores';
import { useBaseStore, useBlockchain, useWalletStore } from '@/stores';
import type { Icon } from '@iconify/vue';
import { ref, computed } from 'vue';
const walletStore = useWalletStore();
const chainStore = useBlockchain();
const baseStore = useBaseStore()
// walletStore.$subscribe((m, s) => {
// console.log(m, s);
// });
@ -30,11 +32,7 @@ const tipMsg = computed(() => {
: { class: 'success', msg: 'Copy Success!' };
});
const addressChange = computed(() => {
return walletStore?.currentAddress || walletStore?.walletIsConnected
? true
: false;
});
</script>
<template>
@ -104,8 +102,8 @@ const addressChange = computed(() => {
<div class="footer-modal">
<Teleport to="body">
<ping-connect-wallet
:chain-id="'juno-1'"
:hd-path="`m/44'/118/0'/0/0`"
:chain-id="baseStore.currentChainId"
:hd-path="chainStore.defaultHDPath"
@connect="walletStateChange"
/>
</Teleport>

View File

@ -32,6 +32,9 @@ export const useBaseStore = defineStore('baseStore', {
blockchain() {
return useBlockchain();
},
currentChainId(): string {
return this.latest.block?.header.chain_id || ""
},
txsInRecents() {
const txs = [] as { height: string; hash: string; tx: DecodedTxRaw }[];
this.recents.forEach((b) =>