Skip to content

Commit 399a82a

Browse files
committed
fix: prevent workspace state polling when unauthenticated
1 parent 2f8819e commit 399a82a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/frontend/src/pad/controls/StateIndicator.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ import '../styles/index.scss';
44

55
export const StateIndicator: React.FC = () => {
66
const { data: isAuthenticated, isLoading: isAuthLoading } = useAuthCheck();
7+
8+
// Only fetch workspace state if authenticated
79
const { data: workspaceState, isLoading: isWorkspaceLoading } = useWorkspaceState({
810
queryKey: ['workspaceState'],
911
enabled: isAuthenticated === true && !isAuthLoading,
12+
// Explicitly set refetchInterval to false when not authenticated
13+
refetchInterval: isAuthenticated === true ? undefined : false,
1014
});
1115

1216
const getStateClassName = () => {

0 commit comments

Comments
 (0)