From 97f06c08f881510d6ef3d627abedbab8b32fe7cc Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Tue, 3 Dec 2024 15:42:31 +0000 Subject: [PATCH] If any swap pool requests fail still return the successful responses (#6961) --- frontend/openchat-agent/src/services/dexes/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/openchat-agent/src/services/dexes/index.ts b/frontend/openchat-agent/src/services/dexes/index.ts index aac846cb89..789e436abb 100644 --- a/frontend/openchat-agent/src/services/dexes/index.ts +++ b/frontend/openchat-agent/src/services/dexes/index.ts @@ -85,7 +85,9 @@ export class DexesAgent { }), ); } - return Promise.all(promises).then((r) => r.flat()); + return Promise.allSettled(promises).then((result) => + result.flatMap((r) => (r.status === "fulfilled" ? r.value : [])), + ); } private quoteSingle(