diff --git a/public/js/app.js b/public/js/app.js index caedc7b..925edf9 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -17,6 +17,11 @@ const App = { try { const s = await API.get('/install/status'); if (!s.installed) { location.hash = '#/install'; return; } } catch { location.hash = '#/install'; return; } this._footerLoaded = false; window.addEventListener('hashchange', () => this.route()); + window.onerror = (msg, url, line, col, err) => { + console.error('JS Error:', msg, url, line, col); + const el = document.getElementById('sidebar-nav'); + if (el) el.insertAdjacentHTML('beforeend', '
Error: ' + String(msg).substring(0,80) + '
'); + }; document.getElementById('modal-close').onclick = () => this.closeModal(); document.addEventListener('click', (e) => { const action = e.target.closest('[data-action]');