mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-05 22:28:20 -05:00
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:
@@ -133,10 +133,6 @@ const Setup = () => {
|
|||||||
setCurrentStep(3);
|
setCurrentStep(3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentStep === 3) {
|
|
||||||
validateLibraries();
|
|
||||||
}
|
|
||||||
}, [
|
}, [
|
||||||
settings.currentSettings.mediaServerType,
|
settings.currentSettings.mediaServerType,
|
||||||
settings.currentSettings.initialized,
|
settings.currentSettings.initialized,
|
||||||
@@ -148,6 +144,13 @@ const Setup = () => {
|
|||||||
validateLibraries,
|
validateLibraries,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (currentStep === 3) {
|
||||||
|
validateLibraries();
|
||||||
|
}
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [currentStep]);
|
||||||
|
|
||||||
const handleComplete = () => {
|
const handleComplete = () => {
|
||||||
validateLibraries();
|
validateLibraries();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user