Skip to content

Commit

Permalink
fix fetching on init
Browse files Browse the repository at this point in the history
  • Loading branch information
archeoss committed Feb 1, 2024
1 parent 9aa6e15 commit 3678af2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions frontend/src/components/dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,14 @@ const Dashboard = () => {
);

useEffect(() => {
if (!context.enabled) {
if (!isPageLoaded) {
fetchData();
}

setIsPageLoaded(true);
}, [fetchData, context.enabled]);
}, [fetchData, isPageLoaded]);

useEffect(() => {
if (!context.enabled) {
fetchData();
}

const interval = setInterval(() => {
if (context.enabled) {
fetchData();
Expand Down

0 comments on commit 3678af2

Please sign in to comment.