mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-11-20 12:44:38 +01:00
feat: better file normalization (#10024)
* feat: better file normalization * fix lint * fix png detection * optimize * fix type
This commit is contained in:
@@ -470,13 +470,14 @@ export const parseDataTransferEvent = async (
|
||||
Array.from(items || []).map(
|
||||
async (item): Promise<ParsedDataTransferItem | null> => {
|
||||
if (item.kind === "file") {
|
||||
const file = item.getAsFile();
|
||||
let file = item.getAsFile();
|
||||
if (file) {
|
||||
const fileHandle = await getFileHandle(item);
|
||||
file = await normalizeFile(file);
|
||||
return {
|
||||
type: file.type,
|
||||
kind: "file",
|
||||
file: await normalizeFile(file),
|
||||
file,
|
||||
fileHandle,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user