fix: corregge drag & drop e riconoscimento estensioni CAD versionate

This commit is contained in:
2026-03-05 16:46:03 +01:00
parent 8edc2673b3
commit 5b65a9bd04
3 changed files with 21 additions and 8 deletions

View File

@@ -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');