Skip to content

Commit

Permalink
Update ServiceMarket.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
huhuanming committed Dec 23, 2024
1 parent ab8d1e0 commit 0f5c10a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/kit-bg/src/services/ServiceMarket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand All @@ -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 {
Expand Down

0 comments on commit 0f5c10a

Please sign in to comment.