From 1d6248bd9f98390617c8366e50fdc357ca0c7af0 Mon Sep 17 00:00:00 2001 From: impelcrypto <92044428+impelcrypto@users.noreply.github.com> Date: Thu, 2 Nov 2023 16:54:03 +0800 Subject: [PATCH] fix: modified rendering news list (#1005) --- .../my-staking/components/NewsArea.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/dapp-staking/my-staking/components/NewsArea.vue b/src/components/dapp-staking/my-staking/components/NewsArea.vue index 02f118843..ea722c1d6 100644 --- a/src/components/dapp-staking/my-staking/components/NewsArea.vue +++ b/src/components/dapp-staking/my-staking/components/NewsArea.vue @@ -130,14 +130,16 @@ export default defineComponent({ if (result.value) { // Currently only one tag can be displayed on UI, so let's pick the first one // link property is missing from SubSocial data. - items.value = result.value.posts.map((x: Data) => { - return { - tag: x.tag.split(',')[0], - title: x.title, - link: x.link, - img: 'https://ipfs.subsocial.network/ipfs/' + x.img, - }; - }); + items.value = result.value.posts + .map((x: Data) => { + return { + tag: x.tag && x.tag.includes(',') ? x.tag.split(',')[0] : x.tag, + title: x.title, + link: x.link, + img: 'https://ipfs.subsocial.network/ipfs/' + x.img, + }; + }) + .filter((x: Data) => x.tag !== null); setDataArray(); handlePageUpdate(); }