repair: sollution brand-device
This commit is contained in:
@@ -48,6 +48,16 @@ const SolutionFieldNew = ({
|
||||
|
||||
const [deleteCounter, setDeleteCounter] = useState(0);
|
||||
|
||||
// Reset internal state when form is reset to initial values
|
||||
React.useEffect(() => {
|
||||
// Check if form is in initial/reset state (name is empty)
|
||||
if (!nameValue || nameValue === '') {
|
||||
setCurrentFile(null);
|
||||
setIsDeleted(false);
|
||||
setDeleteCounter(prev => prev + 1);
|
||||
}
|
||||
}, [nameValue]);
|
||||
|
||||
React.useEffect(() => {
|
||||
const getFileFromFormValues = () => {
|
||||
const hasValidFileUpload = fileUpload && typeof fileUpload === 'object' && Object.keys(fileUpload).length > 0;
|
||||
|
||||
Reference in New Issue
Block a user