Skip to content

Commit

Permalink
Refactor dashboard page to correctly handle requests
Browse files Browse the repository at this point in the history
  • Loading branch information
chimpdev committed Sep 5, 2024
1 parent daf30b1 commit ce6fd69
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions client/app/(dashboard)/dashboard/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ export default function Page() {
await sleep(config.dashboardRequestDelay);

fetchData([params.fetchKey]);
}

for (const item of data) {
params.action(item);
} else {
for (const item of data) {
params.action(item);

await sleep(config.dashboardRequestDelay);
await sleep(config.dashboardRequestDelay);

if (data.indexOf(item) === data.length - 1) fetchData([params.fetchKey]);
if (data.indexOf(item) === data.length - 1) fetchData([params.fetchKey]);
}
}
}

Expand Down

0 comments on commit ce6fd69

Please sign in to comment.