From 5566bcce1930df718b4cd19545c898732bf47661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonia=20P=C3=A9rez-Cerezo?= Date: Wed, 12 Mar 2025 14:59:30 +0100 Subject: [PATCH] Do not enter edit mode if user clicked cancel --- frontend/common/map.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/common/map.js b/frontend/common/map.js index 55d8f31..f0936da 100644 --- a/frontend/common/map.js +++ b/frontend/common/map.js @@ -141,6 +141,9 @@ async function pickDirectory(e){ L.DomEvent.preventDefault(e); if (!editMode) { dirHandle = await window.showDirectoryPicker({ mode: 'readwrite' }); + if (!dirHandle) { + return; + } for (i = 0; i < l.length ; i++ ) { console.log(l[i].dirname); if (l[i].dirname === dirHandle.name) {