Skip to content

Commit ff1d202

Browse files
athul-rsclaude
andcommitted
fix: Refactor beforeUpload to avoid multiple identical returns
- Consolidated multiple return false statements into single return - Added comment explaining why false is always returned (manual upload) - Resolves SonarQube code smell about functions with duplicate returns 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 323faaf commit ff1d202

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

frontend/src/components/agency/file-upload/FileUpload.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ const FileUpload = ({
2121
const beforeUpload = (file) => {
2222
if (fileList.length >= WORKFLOW_PAGE_MAX_FILES) {
2323
message.error(WORKFLOW_VALIDATION_MESSAGES.MAX_FILES_EXCEEDED);
24-
return false;
24+
} else {
25+
setFileList([...fileList, file]);
2526
}
26-
setFileList([...fileList, file]);
27-
return false;
27+
return false; // Always prevent automatic upload (manual upload on submit)
2828
};
2929

3030
const submitFile = () => {

0 commit comments

Comments
 (0)