Skip to content

Commit

Permalink
add artificial delay to paginated results
Browse files Browse the repository at this point in the history
  • Loading branch information
xzilja committed Aug 14, 2023
1 parent fa2480c commit 34e86f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core/src/controllers/ApiController.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 34e86f9

Please sign in to comment.