Skip to content

Commit

Permalink
Merge pull request #1347 from akto-api-security/hotfix/fix_logout_issue
Browse files Browse the repository at this point in the history
Fixing polling api for logout
  • Loading branch information
avneesh-akto authored Aug 12, 2024
2 parents 828820b + 31ccd8a commit fa2b044
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export const PollingProvider = ({ children }) => {
totalTestsQueued: 0,
testRunsArr: [],
});

const intervalIdRef = useRef(null);
const setCurrentTestingRuns = TestingStore(state => state.setCurrentTestingRuns)

Expand All @@ -37,9 +36,9 @@ export const PollingProvider = ({ children }) => {
}, 2000);
intervalIdRef.current = id;
};

fetchTestingStatus();

if (window.location.pathname.startsWith('/dashboard')) {
fetchTestingStatus();
}
return () => {
clearInterval(intervalIdRef.current);
};
Expand Down

0 comments on commit fa2b044

Please sign in to comment.