forked from cerc-io/cosmos-explorer
fix connect wallet issue
This commit is contained in:
parent
03abd9c75a
commit
94ba4b1668
@ -1,8 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useWalletStore } from '@/stores';
|
import { useBaseStore, useBlockchain, useWalletStore } from '@/stores';
|
||||||
import type { Icon } from '@iconify/vue';
|
import type { Icon } from '@iconify/vue';
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
const walletStore = useWalletStore();
|
const walletStore = useWalletStore();
|
||||||
|
const chainStore = useBlockchain();
|
||||||
|
const baseStore = useBaseStore()
|
||||||
// walletStore.$subscribe((m, s) => {
|
// walletStore.$subscribe((m, s) => {
|
||||||
// console.log(m, s);
|
// console.log(m, s);
|
||||||
// });
|
// });
|
||||||
@ -30,11 +32,7 @@ const tipMsg = computed(() => {
|
|||||||
: { class: 'success', msg: 'Copy Success!' };
|
: { class: 'success', msg: 'Copy Success!' };
|
||||||
});
|
});
|
||||||
|
|
||||||
const addressChange = computed(() => {
|
|
||||||
return walletStore?.currentAddress || walletStore?.walletIsConnected
|
|
||||||
? true
|
|
||||||
: false;
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -104,8 +102,8 @@ const addressChange = computed(() => {
|
|||||||
<div class="footer-modal">
|
<div class="footer-modal">
|
||||||
<Teleport to="body">
|
<Teleport to="body">
|
||||||
<ping-connect-wallet
|
<ping-connect-wallet
|
||||||
:chain-id="'juno-1'"
|
:chain-id="baseStore.currentChainId"
|
||||||
:hd-path="`m/44'/118/0'/0/0`"
|
:hd-path="chainStore.defaultHDPath"
|
||||||
@connect="walletStateChange"
|
@connect="walletStateChange"
|
||||||
/>
|
/>
|
||||||
</Teleport>
|
</Teleport>
|
||||||
|
@ -32,6 +32,9 @@ export const useBaseStore = defineStore('baseStore', {
|
|||||||
blockchain() {
|
blockchain() {
|
||||||
return useBlockchain();
|
return useBlockchain();
|
||||||
},
|
},
|
||||||
|
currentChainId(): string {
|
||||||
|
return this.latest.block?.header.chain_id || ""
|
||||||
|
},
|
||||||
txsInRecents() {
|
txsInRecents() {
|
||||||
const txs = [] as { height: string; hash: string; tx: DecodedTxRaw }[];
|
const txs = [] as { height: string; hash: string; tx: DecodedTxRaw }[];
|
||||||
this.recents.forEach((b) =>
|
this.recents.forEach((b) =>
|
||||||
|
Loading…
Reference in New Issue
Block a user