Skip to content

Commit

Permalink
Stop API calls from hidden dashboard items (#902)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithmohan authored May 10, 2024
1 parent 431036c commit 7906672
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/dashboard/DashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ function DashboardPage() {
window.dispatchEvent(new Event('resize'));
}, [currentLayout]);

if (!settingsQuery.isSuccess) {
// settingsQuery.isSuccess is always true due to the existence of initialData
// settingsQuery.isStale will be true before the first actual fetch and it will never be true for fetched data
// This is kind of a hack but it works
if (settingsQuery.isStale) {
return (
<div className="flex grow items-center justify-center text-panel-text-primary">
<Icon path={mdiLoading} size={4} spin />
Expand Down

0 comments on commit 7906672

Please sign in to comment.