From ca29dbba7d7fef968ab0f28b18b0cb140f3df5b1 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Sun, 28 Apr 2024 09:17:48 +0800 Subject: [PATCH] fixed issues --- src/stores/useDashboard.ts | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/stores/useDashboard.ts b/src/stores/useDashboard.ts index 530b96a4..a1e4bc95 100644 --- a/src/stores/useDashboard.ts +++ b/src/stores/useDashboard.ts @@ -138,19 +138,21 @@ function apiConverter(api: any[]) { export function fromLocal(lc: LocalConfig): ChainConfig { const conf = {} as ChainConfig; - conf.assets = lc.assets.map((x) => ({ - name: x.base, - base: x.base, - display: x.symbol, - symbol: x.symbol, - logo_URIs: { svg: x.logo }, - coingecko_id: x.coingecko_id, - exponent: x.exponent, - denom_units: [ - { denom: x.base, exponent: 0 }, - { denom: x.symbol.toLowerCase(), exponent: Number(x.exponent) }, - ], - })); + if(lc.assets && Array.isArray(lc.assets)) { + conf.assets = lc.assets.map((x) => ({ + name: x.base, + base: x.base, + display: x.symbol, + symbol: x.symbol, + logo_URIs: { svg: x.logo }, + coingecko_id: x.coingecko_id, + exponent: x.exponent, + denom_units: [ + { denom: x.base, exponent: 0 }, + { denom: x.symbol.toLowerCase(), exponent: Number(x.exponent) }, + ], + })); + } conf.versions = { cosmosSdk: lc.sdk_version }