fix: [3958]: restrict dashboard api call on other pages (#4066)

This commit is contained in:
Vikrant Gupta 2023-11-27 17:49:22 +05:30 committed by GitHub
parent 1e4cf2513c
commit e18bb7d5bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,7 +185,12 @@ export function DashboardProvider({
);
useEffect(() => {
if (isVisible && updatedTimeRef.current) {
// make the call on tab visibility only if the user is on dashboard / widget page
if (
isVisible &&
updatedTimeRef.current &&
(!!isDashboardPage || !!isDashboardWidgetPage)
) {
dashboardResponse.refetch();
}
// eslint-disable-next-line react-hooks/exhaustive-deps