mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
fix(site/src/pages/AgentsPage): use biome ignore for useExhaustiveDependencies
The useEffect that resets parent mutation state when a new server is opened intentionally elides onOpen from its dependency list to avoid firing on every parent rerender. The previous comment used eslint-style syntax which biome ignores, so the rule still flagged the hook in pre-commit.
This commit is contained in:
@@ -306,13 +306,11 @@ const ConfigureHeadersDialog: FC<ConfigureHeadersDialogProps> = ({
|
||||
// When a new server is opened, reset the parent mutation state so a
|
||||
// previous server's error banner does not bleed into this session.
|
||||
const openServerId = server?.id ?? null;
|
||||
// biome-ignore lint/correctness/useExhaustiveDependencies: only fire when the open server identity changes, not on every render of the onOpen callback reference
|
||||
useEffect(() => {
|
||||
if (openServerId !== null) {
|
||||
onOpen?.();
|
||||
}
|
||||
// We only want to fire when the open server identity changes,
|
||||
// not on every render of the onOpen callback reference.
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [openServerId]);
|
||||
const hasAnyExisting = requiredKeys.some(
|
||||
(k) => headerHasValues?.[k] === true,
|
||||
|
||||
Reference in New Issue
Block a user