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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user