mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
fix: dedupe accepted extensions in dropzone error message
This commit is contained in:
@@ -134,9 +134,9 @@ const getRootError = (
|
||||
const errors = errorCodes.map((error) => {
|
||||
switch (error) {
|
||||
case "file-invalid-type":
|
||||
const acceptedTypes = Object.values(limits.accept ?? {})
|
||||
.flat()
|
||||
.join(", ");
|
||||
const acceptedTypes = Array.from(
|
||||
new Set(Object.values(limits.accept ?? {}).flat()),
|
||||
).join(", ");
|
||||
return `only ${acceptedTypes} are allowed`;
|
||||
case "file-too-large":
|
||||
const maxMb = limits.maxSize
|
||||
|
||||
Reference in New Issue
Block a user