mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-22 19:23:31 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user