Skip to content

Commit 1b00fb8

Browse files
committed
refactor(components): add stable setter deps to SettingsTab callbacks
The setters returned by useSettingsInit are stable React setState references, but eslint's exhaustive-deps lint still wants them in the dependency arrays. Include them to silence the warnings and document the dependency clearly.
1 parent 0a2f762 commit 1b00fb8

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/components/Settings/SettingsTab.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ export function SettingsTab() {
596596
}, [
597597
runDeploymentPreflight,
598598
getDeploymentHealthSummary,
599+
setDeploymentHealth,
599600
showSuccess,
600601
showError,
601602
]);
@@ -610,15 +611,15 @@ export function SettingsTab() {
610611
showError(`Failed to update ${integrationType}: ${err}`);
611612
}
612613
},
613-
[configureIntegration, listIntegrations, showError],
614+
[configureIntegration, listIntegrations, setIntegrations, showError],
614615
);
615616

616617
const updateQualityThreshold = useCallback(
617618
<K extends keyof ResponseQualityThresholds>(key: K, value: number) => {
618619
setQualityThresholds((prev) => ({ ...prev, [key]: value }));
619620
setQualityThresholdError(null);
620621
},
621-
[],
622+
[setQualityThresholds],
622623
);
623624

624625
const handleSaveQualityThresholds = useCallback(() => {
@@ -631,14 +632,14 @@ export function SettingsTab() {
631632
setQualityThresholds(saved);
632633
setQualityThresholdError(null);
633634
showSuccess("Response quality coaching thresholds updated");
634-
}, [qualityThresholds, showSuccess]);
635+
}, [qualityThresholds, setQualityThresholds, showSuccess]);
635636

636637
const handleResetQualityThresholds = useCallback(() => {
637638
const defaults = resetResponseQualityThresholds();
638639
setQualityThresholds(defaults);
639640
setQualityThresholdError(null);
640641
showSuccess("Response quality coaching thresholds reset to defaults");
641-
}, [showSuccess]);
642+
}, [setQualityThresholds, showSuccess]);
642643

643644
const searchApiEmbeddingBadge = getSearchApiEmbeddingBadge(
644645
searchApiEmbeddingStatus,

0 commit comments

Comments
 (0)