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) => {
|
const errors = errorCodes.map((error) => {
|
||||||
switch (error) {
|
switch (error) {
|
||||||
case "file-invalid-type":
|
case "file-invalid-type":
|
||||||
const acceptedTypes = Object.values(limits.accept ?? {})
|
const acceptedTypes = Array.from(
|
||||||
.flat()
|
new Set(Object.values(limits.accept ?? {}).flat()),
|
||||||
.join(", ");
|
).join(", ");
|
||||||
return `only ${acceptedTypes} are allowed`;
|
return `only ${acceptedTypes} are allowed`;
|
||||||
case "file-too-large":
|
case "file-too-large":
|
||||||
const maxMb = limits.maxSize
|
const maxMb = limits.maxSize
|
||||||
|
|||||||
Reference in New Issue
Block a user