Skip to content

Commit d767f68

Browse files
committed
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.
1 parent 72547e3 commit d767f68

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/public/js/ui/dashboard.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,9 +696,15 @@ PulseApp.ui.dashboard = (() => {
696696
let previousGroupByNode = null;
697697

698698
function updateDashboardTable() {
699+
// If elements aren't initialized yet, try to initialize them
699700
if (!tableBodyEl || !statusElementEl) {
700-
console.error('Dashboard table body or status element not found/initialized!');
701-
return;
701+
tableBodyEl = document.querySelector('#main-table tbody');
702+
statusElementEl = document.getElementById('dashboard-status-text');
703+
704+
// If still not found, silently return (not an error during initial load)
705+
if (!tableBodyEl || !statusElementEl) {
706+
return;
707+
}
702708
}
703709

704710
// Find the scrollable container

0 commit comments

Comments
 (0)