diff --git a/load-app.js b/load-app.js index 899f73a..09a71e0 100644 --- a/load-app.js +++ b/load-app.js @@ -132,7 +132,12 @@ class LeafletElement extends HTMLElement { } customElements.define('leaflet-map', LeafletElement); -let opfs = await navigator.storage.getDirectory(); +let opfs; +try { + opfs = await navigator.storage.getDirectory(); +} catch(e) { + +} async function init_app() { const compilation_error = await show_error; @@ -180,10 +185,14 @@ async function init_app() { const send_value_handlers = { save: async ({markers}) => { - const f = await opfs.getFileHandle(`markers-${map_id}.json`, {create:true}); - const w = await f.createWritable(); - await w.write(JSON.stringify(markers)); - await w.close(); + try { + const f = await opfs.getFileHandle(`markers-${map_id}.json`, {create:true}); + const w = await f.createWritable(); + await w.write(JSON.stringify(markers)); + await w.close(); + } catch(e) { + + } const fd = new FormData(); fd.set('content', JSON.stringify(markers));