From 349813929b4c05e3a11e8258681485eff291e04d Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Sat, 20 May 2023 18:06:22 +0800 Subject: [PATCH] fix endpoint switch error --- src/layouts/components/DefaultLayout.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/layouts/components/DefaultLayout.vue b/src/layouts/components/DefaultLayout.vue index b9e5e9b0..577b06e8 100644 --- a/src/layouts/components/DefaultLayout.vue +++ b/src/layouts/components/DefaultLayout.vue @@ -13,16 +13,17 @@ import { useDashboard } from '@/stores/useDashboard'; import NavBarI18n from './NavBarI18n.vue'; import NavBarWallet from './NavBarWallet.vue'; import { useBlockchain } from '@/stores'; -import { computed } from 'vue'; const { appRouteTransition } = useThemeConfig(); const dashboard = useDashboard(); dashboard.initial(); const blockchain = useBlockchain(); -// blockchain.initial() + +const current = ref("") blockchain.$subscribe((m, s) => { - if (!Array.isArray(m.events) && m.events && m.events.key === 'chainName') { + if(current.value != s.chainName) { + current.value = s.chainName blockchain.initial(); } });