debug: add window.onerror to display JS errors in sidebar
This commit is contained in:
@@ -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; }
|
try { const s = await API.get('/install/status'); if (!s.installed) { location.hash = '#/install'; return; } } catch { location.hash = '#/install'; return; }
|
||||||
this._footerLoaded = false;
|
this._footerLoaded = false;
|
||||||
window.addEventListener('hashchange', () => this.route());
|
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', '<div style="color:red;font-size:10px;padding:8px">Error: ' + String(msg).substring(0,80) + '</div>');
|
||||||
|
};
|
||||||
document.getElementById('modal-close').onclick = () => this.closeModal();
|
document.getElementById('modal-close').onclick = () => this.closeModal();
|
||||||
document.addEventListener('click', (e) => {
|
document.addEventListener('click', (e) => {
|
||||||
const action = e.target.closest('[data-action]');
|
const action = e.target.closest('[data-action]');
|
||||||
|
|||||||
Reference in New Issue
Block a user