fix: eliminate dashboard initialization error on first load

- Make updateDashboardTable gracefully handle uninitialized elements
- Try to find elements if not already cached
- Silently return instead of logging error during initial page load

This prevents the 'Dashboard table body or status element not found' error when the socket connection updates arrive before DOM is ready.
This commit is contained in:
courtmanr@gmail.com
2025-05-30 11:57:18 +01:00
parent b684ca9205
commit f568dd4f72
+8 -2
View File
@@ -696,9 +696,15 @@ PulseApp.ui.dashboard = (() => {
let previousGroupByNode = null;
function updateDashboardTable() {
// If elements aren't initialized yet, try to initialize them
if (!tableBodyEl || !statusElementEl) {
console.error('Dashboard table body or status element not found/initialized!');
return;
tableBodyEl = document.querySelector('#main-table tbody');
statusElementEl = document.getElementById('dashboard-status-text');
// If still not found, silently return (not an error during initial load)
if (!tableBodyEl || !statusElementEl) {
return;
}
}
// Find the scrollable container