fix: synthesize readable filename for rejected clipboard pastes

Rejected clipboard items now show as "pasted-item.tiff" instead
of raw MIME subtype, so the upload panel entry is readable.
This commit is contained in:
Hiren Kangad
2026-03-10 19:46:17 +05:30
parent 45891a278c
commit 065762d273
+3 -2
View File
@@ -299,9 +299,10 @@ export function setupPaste(
// Reject unsupported media types with feedback // Reject unsupported media types with feedback
if (!ALLOWED_MIME_TYPES.has(item.type)) { if (!ALLOWED_MIME_TYPES.has(item.type)) {
const ext = extFromMime(item.type);
uploads?.addRejected( uploads?.addRejected(
item.type.split('/')[1] || 'unknown', `pasted-item${ext.startsWith('.') ? ext : '.' + ext}`,
`Unsupported format: ${extFromMime(item.type)}`, `Unsupported format: ${ext}`,
); );
continue; continue;
} }