Skip to content

Commit

Permalink
ADD: edgecase error handling for files
Browse files Browse the repository at this point in the history
Co-authored-by: andregroseth <[email protected]>
  • Loading branch information
JeremiahUy and andregroseth committed Feb 14, 2025
1 parent 8e372d7 commit 66f3aee
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export const CustomFileUpload = (props: IProps) => {
if (files.map((file) => file.file.name).includes(file.name)) {
return 'Filen er allerede lastet opp'
}
if (files.map((file) => file.file.size === 0)) {
return 'Ugyldig filestørrelse: 0 MB'
}
return true
}}
onSelect={(newFiles: FileObject[]) => {
Expand Down

0 comments on commit 66f3aee

Please sign in to comment.