Prevent lag on insights page
- Queries were being run in parallel, now they run sequentially - Add 400ms delay before starting the queries, to allow for drawer navigation animation.
This commit is contained in:
parent
8a88c8e7af
commit
31b11aefd6
|
@ -51,8 +51,17 @@ export default function InsightsPage() {
|
||||||
having hour is not null
|
having hour is not null
|
||||||
ORDER BY hour
|
ORDER BY hour
|
||||||
`;
|
`;
|
||||||
AppDataSource.manager.query(selectWeeks).then(setWeekCounts);
|
|
||||||
AppDataSource.manager.query(selectHours).then(setHourCounts);
|
setTimeout(
|
||||||
|
() =>
|
||||||
|
AppDataSource.manager
|
||||||
|
.query(selectWeeks)
|
||||||
|
.then(setWeekCounts)
|
||||||
|
.then(() =>
|
||||||
|
AppDataSource.manager.query(selectHours).then(setHourCounts)
|
||||||
|
),
|
||||||
|
400
|
||||||
|
);
|
||||||
}, [period])
|
}, [period])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user