From 0f5c10a83270472a707551340c1fde125e3431f6 Mon Sep 17 00:00:00 2001 From: huhuanming Date: Tue, 24 Dec 2024 01:39:42 +0800 Subject: [PATCH] Update ServiceMarket.ts --- packages/kit-bg/src/services/ServiceMarket.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/kit-bg/src/services/ServiceMarket.ts b/packages/kit-bg/src/services/ServiceMarket.ts index 456e7a66484..a2903c5ad0c 100644 --- a/packages/kit-bg/src/services/ServiceMarket.ts +++ b/packages/kit-bg/src/services/ServiceMarket.ts @@ -106,7 +106,7 @@ class ServiceMarket extends ServiceBase { const keys = Object.keys(detailPlatforms); const client = await this.getClient(EServiceEndpointEnum.Utility); try { - const poolsData = await Promise.all( + const poolsData = await Promise.allSettled( keys.map((key) => client.get<{ data: IMarketDetailPool[]; @@ -121,7 +121,14 @@ class ServiceMarket extends ServiceBase { return keys .map((key, index) => ({ ...detailPlatforms[key], - data: poolsData[index].data.data, + data: + poolsData[index].status === 'fulfilled' + ? ( + poolsData[index].value as { + data: { data: IMarketDetailPool[] }; + } + ).data.data + : [], })) .filter((i) => i.data.length); } catch {