fix(setup): resolve looping library validation error message (#1316)

This PR fixes a bug where the validation error message is displayed over and over because of a React
useEffect dependency issue. Previously, the `validateLibraries()` function was being called inside a
useEffect that depended on a state that this function was updating.
This commit is contained in:
Gauthier
2025-01-30 11:22:23 +01:00
committed by GitHub
parent 418f0c2eb8
commit 6ab463285d

View File

@@ -133,10 +133,6 @@ const Setup = () => {
setCurrentStep(3);
}
}
if (currentStep === 3) {
validateLibraries();
}
}, [
settings.currentSettings.mediaServerType,
settings.currentSettings.initialized,
@@ -148,6 +144,13 @@ const Setup = () => {
validateLibraries,
]);
useEffect(() => {
if (currentStep === 3) {
validateLibraries();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [currentStep]);
const handleComplete = () => {
validateLibraries();
};