refactor: simplify FileUploadComponent logic and remove unnecessary condition
- Removed the check for record mode in the FileUploadComponent, streamlining the file loading process. - Updated the dependency array in the useEffect hook to exclude isRecordMode, ensuring cleaner and more efficient component behavior. These changes aim to enhance the clarity and maintainability of the FileUploadComponent, improving overall functionality.
This commit is contained in:
parent
c634e1e054
commit
5fa905f9ab
|
|
@ -207,9 +207,6 @@ const FileUploadComponent: React.FC<FileUploadComponentProps> = ({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 등록 모드(새 레코드)일 때는 이전 파일을 로드하지 않음
|
|
||||||
if (!isRecordMode) return;
|
|
||||||
|
|
||||||
const rawValue = String(imageObjidFromFormData);
|
const rawValue = String(imageObjidFromFormData);
|
||||||
// 콤마 구분 다중 objid 또는 단일 objid 모두 처리
|
// 콤마 구분 다중 objid 또는 단일 objid 모두 처리
|
||||||
const objids = rawValue.split(',').map(s => s.trim()).filter(s => /^\d+$/.test(s));
|
const objids = rawValue.split(',').map(s => s.trim()).filter(s => /^\d+$/.test(s));
|
||||||
|
|
@ -265,7 +262,7 @@ const FileUploadComponent: React.FC<FileUploadComponentProps> = ({
|
||||||
console.error("🖼️ [FileUploadComponent] 파일 정보 조회 오류:", error);
|
console.error("🖼️ [FileUploadComponent] 파일 정보 조회 오류:", error);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
}, [imageObjidFromFormData, columnName, component.id, isRecordMode]);
|
}, [imageObjidFromFormData, columnName, component.id]);
|
||||||
|
|
||||||
// 🎯 화면설계 모드에서 실제 화면으로의 실시간 동기화 이벤트 리스너
|
// 🎯 화면설계 모드에서 실제 화면으로의 실시간 동기화 이벤트 리스너
|
||||||
// 🆕 columnName도 체크하여 같은 화면의 다른 파일 업로드 컴포넌트와 구분
|
// 🆕 columnName도 체크하여 같은 화면의 다른 파일 업로드 컴포넌트와 구분
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue