From f69546d44f946b7d24beeda19677005e4bf3e91a Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Mon, 19 Jun 2023 08:18:15 +0800 Subject: [PATCH] improve logo --- src/modules/[chain]/staking/index.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/modules/[chain]/staking/index.vue b/src/modules/[chain]/staking/index.vue index 88e02133..7a9c6e90 100644 --- a/src/modules/[chain]/staking/index.vue +++ b/src/modules/[chain]/staking/index.vue @@ -125,18 +125,18 @@ function isFeatured(endpoints: string[], who?: {website?: string, moniker: strin const list = computed(() => { if (tab.value === 'active') { - return staking.validators.map((x, i) => ({v: x, rank: calculateRank(i)})); + return staking.validators.map((x, i) => ({v: x, rank: calculateRank(i), logo: logo(x.description.identity)})); } else if (tab.value === 'featured') { const endpoint = chainStore.current?.endpoints?.rest?.map(x => x.provider) if(endpoint) { endpoint.push('ping') return staking.validators .filter(x => isFeatured(endpoint, x.description)) - .map((x, i) => ({v: x, rank: 'primary'})); + .map((x, i) => ({v: x, rank: 'primary', logo: logo(x.description.identity)})); } return [] } - return unbondList.value.map((x, i) => ({v: x, rank: 'primary'})); + return unbondList.value.map((x, i) => ({v: x, rank: 'primary', logo: logo(x.description.identity)})); }); const loadAvatars = () => { @@ -175,7 +175,7 @@ const loadAvatars = () => { }; const logo = (identity?: string) => { - if (!identity) return ''; + if (!identity || !avatars.value[identity]) return ''; const url = avatars.value[identity] || ''; return url.startsWith('http') ? url @@ -286,7 +286,7 @@ loadAvatars(); @@ -317,8 +317,8 @@ loadAvatars(); >