Skip to content

Commit f07501b

Browse files
committed
fix: skip version check when showDevConsole is false (CopilotKit#2751)
checkForUpdates() fired unconditionally on mount, making a network request even when the dev console was disabled. Now the useEffect short-circuits when showDevConsole is false.
1 parent 789ab17 commit f07501b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • packages/react-ui/src/components/dev-console

packages/react-ui/src/components/dev-console/console.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,16 @@ export function CopilotDevConsole() {
8484
};
8585

8686
useEffect(() => {
87+
if (!showDevConsole) {
88+
return;
89+
}
8790
if (dontRunTwiceInDevMode.current === true) {
8891
return;
8992
}
9093
dontRunTwiceInDevMode.current = true;
9194

9295
checkForUpdates();
93-
}, []);
96+
}, [showDevConsole]);
9497

9598
if (!showDevConsole) {
9699
return null;

0 commit comments

Comments
 (0)