Skip to content

Commit

Permalink
fix: reset errors on ingest change
Browse files Browse the repository at this point in the history
  • Loading branch information
Saelmala committed Nov 15, 2024
1 parent d4a015b commit 883e6e8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/modal/addSrtModal/AddSrtModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export function AddSrtModal({
setIsNameError(false);
}
}
}, [isNameError]);
}, [isNameError, name]);

useEffect(() => {
if (mode === 'Caller' && isPortAlreadyInUseError) {
Expand Down Expand Up @@ -171,6 +171,7 @@ export function AddSrtModal({
if (ingestName) {
setIsIngestNameError(false);
setIsDuplicateNameError(false);
setIsPortAlreadyInUseError(false);
}
}, [ingestName]);

Expand Down Expand Up @@ -384,7 +385,11 @@ export function AddSrtModal({
className="w-full ml-2"
type="text"
value={name}
onChange={handleInputChange(setName, setIsNameError)}
onChange={handleInputChange(
setName,
setIsNameError,
setIsDuplicateNameError
)}
error={isNameError}
/>
{isNameError && (
Expand Down

0 comments on commit 883e6e8

Please sign in to comment.