Do not enter edit mode if user clicked cancel

This commit is contained in:
Antonia 2025-03-12 14:59:30 +01:00
parent 16beaaf071
commit 5566bcce19

View file

@ -141,6 +141,9 @@ async function pickDirectory(e){
L.DomEvent.preventDefault(e); L.DomEvent.preventDefault(e);
if (!editMode) { if (!editMode) {
dirHandle = await window.showDirectoryPicker({ mode: 'readwrite' }); dirHandle = await window.showDirectoryPicker({ mode: 'readwrite' });
if (!dirHandle) {
return;
}
for (i = 0; i < l.length ; i++ ) { for (i = 0; i < l.length ; i++ ) {
console.log(l[i].dirname); console.log(l[i].dirname);
if (l[i].dirname === dirHandle.name) { if (l[i].dirname === dirHandle.name) {