From 34e86f9b8cfd4ab4290cdc027dbc56fca8586ac5 Mon Sep 17 00:00:00 2001 From: Ilja Date: Mon, 14 Aug 2023 19:31:26 +0300 Subject: [PATCH] add artificial delay to paginated results --- packages/core/src/controllers/ApiController.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/src/controllers/ApiController.ts b/packages/core/src/controllers/ApiController.ts index 9232a72d84..dbdde40371 100644 --- a/packages/core/src/controllers/ApiController.ts +++ b/packages/core/src/controllers/ApiController.ts @@ -1,5 +1,6 @@ import { subscribeKey as subKey } from 'valtio/utils' import { proxy } from 'valtio/vanilla' +import { CoreHelperUtil } from '../utils/CoreHelperUtil.js' import { FetchUtil } from '../utils/FetchUtil.js' import type { ApiGetWalletsRequest, @@ -89,7 +90,10 @@ export const ApiController = { exclude } }) - await Promise.all(data.map(({ image_id }) => ApiController.fetchImageBlob(image_id))) + await Promise.all([ + ...data.map(({ image_id }) => ApiController.fetchImageBlob(image_id)), + CoreHelperUtil.wait(300) + ]) state.wallets = [...state.wallets, ...data] state.count = count state.page = page