diff --git a/www/webdav.js b/www/webdav.js index d1ecbcf..9e8f068 100644 --- a/www/webdav.js +++ b/www/webdav.js @@ -157,12 +157,14 @@ const WebDAVNavigator = (url, options) => { }; const wopi_init = async () => { - if (!wopi_discovery_url) { + try { + var d = await reqXML('GET', wopi_discovery_url); + } + catch (e) { + reloadListing(); return; } - var d = await reqXML('GET', wopi_discovery_url); - d.querySelectorAll('app').forEach(app => { var mime = (a = app.getAttribute('name').match(/^.*\/.*$/)) ? a[0] : null; wopi_mimes[mime] = {}; @@ -776,11 +778,10 @@ const WebDAVNavigator = (url, options) => { document.querySelector('html').innerHTML = html_tpl; + // Wait for WOPI discovery before creating the list if (wopi_discovery_url) { - // Wait for WOPI discovery before creating the list wopi_init(); - } - else { + } else { reloadListing(); }