Description
The dashboard polls the Soroban RPC every 5-30 seconds for stream updates. This continues even when the user switches to a different tab or minimizes the browser, wasting bandwidth, battery, and RPC rate limit quota.
Proposed Solution
Use the Page Visibility API to pause polling when the tab is hidden and resume when it becomes visible again.
document.addEventListener('visibilitychange', () => {
if (document.hidden) {
pausePolling();
} else {
resumePolling();
// Immediately fetch fresh data on tab focus
refetchStreams();
}
});
Acceptance Criteria
Description
The dashboard polls the Soroban RPC every 5-30 seconds for stream updates. This continues even when the user switches to a different tab or minimizes the browser, wasting bandwidth, battery, and RPC rate limit quota.
Proposed Solution
Use the Page Visibility API to pause polling when the tab is hidden and resume when it becomes visible again.
Acceptance Criteria