fix: corregge drag & drop e riconoscimento estensioni CAD versionate
This commit is contained in:
@@ -106,8 +106,15 @@ dropZone.addEventListener('drop', async (event) => {
|
||||
event.preventDefault();
|
||||
dropZone.classList.remove('active');
|
||||
|
||||
const droppedFile = event.dataTransfer?.files?.[0];
|
||||
const droppedPath = droppedFile?.path;
|
||||
const droppedFile = event.dataTransfer?.files?.[0] || event.dataTransfer?.items?.[0]?.getAsFile?.();
|
||||
let droppedPath = '';
|
||||
if (droppedFile) {
|
||||
try {
|
||||
droppedPath = window.api.getPathForDroppedFile(droppedFile) || droppedFile.path || '';
|
||||
} catch {
|
||||
droppedPath = '';
|
||||
}
|
||||
}
|
||||
|
||||
if (!droppedPath) {
|
||||
setDropZoneError('Elemento non valido. Trascina una cartella o un file .zip');
|
||||
|
||||
Reference in New Issue
Block a user