fix events

This commit is contained in:
liangping 2023-05-20 16:04:54 +08:00
parent 85f8ef1db5
commit ef3599e9ca
5 changed files with 5 additions and 8 deletions

View File

@ -3,11 +3,6 @@ import { useBlockchain, useBaseStore } from '@/stores';
const chainStore = useBlockchain();
const baseStore = useBaseStore();
chainStore.initial();
chainStore.$subscribe((m, s) => {
if (!Array.isArray(m.events) && m.events.key === 'endpoint') {
// chainStore.initial();
}
});
</script>
<template>

View File

@ -22,7 +22,7 @@ dashboard.initial();
const blockchain = useBlockchain();
// blockchain.initial()
blockchain.$subscribe((m, s) => {
if (!Array.isArray(m.events) && m.events.key === 'chainName') {
if (!Array.isArray(m.events) && m.events && m.events.key === 'chainName') {
blockchain.initial();
}
});

View File

@ -44,7 +44,7 @@ const ticker = computed(() => store.coinInfo.tickers[store.tickerIndex]);
blockchain.$subscribe((m, s) => {
if (
!Array.isArray(m.events) &&
['chainName', 'endpoint'].includes(m.events.key)
['chainName', 'endpoint'].includes(m.events?.key || "")
) {
store.loadDashboard();
walletStore.loadMyAsset();

View File

@ -11,7 +11,7 @@ const baseStore = useBaseStore()
const endpoint = ref(chainStore.current?.endpoints?.rest?.at(0)?.address)
const chainId = computed(() => baseStore.latest?.block?.header?.chain_id || "")
const chainName = computed(() => chainStore?.chainName || "")
const chainName = computed(() => chainStore?.current?.prettyName || "")
const hdPath = computed(() => {
return `m/44'/${ chainStore.current?.coinType }/0'/0/0`
})

View File

@ -34,6 +34,8 @@ export const useTxDialog = defineStore('txDialogStore', {
this.sender = this.walletAddress;
this.endpoint = this.currentEndpoint || "";
this.params = JSON.stringify(param)
// console.log("dialog:", this.$state)
}
},
});