From 083b59f07cde43b67dddfcab46583eb3479b1a35 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Sat, 10 May 2025 22:11:17 +0000 Subject: [PATCH] avoid requesting infinite acceleration history pages --- frontend/src/app/services/services-api.service.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/services/services-api.service.ts b/frontend/src/app/services/services-api.service.ts index 2408bd47e..828fe5663 100644 --- a/frontend/src/app/services/services-api.service.ts +++ b/frontend/src/app/services/services-api.service.ts @@ -169,9 +169,10 @@ export class ServicesApiServices { page, total: parseInt(response.headers.get('X-Total-Count'), 10) || 0, accelerations: accelerations.concat(response.body || []), + pageAccelerations: response.body || [], })), - switchMap(({page, total, accelerations}) => { - if (accelerations.length >= Math.min(total, limit ?? Infinity) || (findTxid && accelerations.find((acc) => acc.txid === findTxid))) { + switchMap(({page, total, accelerations, pageAccelerations }) => { + if (pageAccelerations.length === 0 || accelerations.length >= Math.min(total, limit ?? Infinity) || (findTxid && accelerations.find((acc) => acc.txid === findTxid))) { return of({ page, total, accelerations }); } else { return getPage$(page + 1, accelerations);