File tree Expand file tree Collapse file tree 4 files changed +23
-16
lines changed
Expand file tree Collapse file tree 4 files changed +23
-16
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,6 @@ import MainContent from "./MainContent.jsx";
55import { withBase } from './utils/paths.js' ;
66
77import RadianceCategory from './components/RadianceCategory.jsx' ;
8- // import { geostationarySatellites } from "./data/geosats";
9- // import { infraredSatellites } from './data/infrasats.js';
10- // import { microwaveSatellites } from './data/microwavesats.js';
118import OzoneObs from './components/OzoneObs.jsx'
129import ConventionalObs from './components/ConventionalObs.jsx' ;
1310
@@ -119,9 +116,19 @@ function App() {
119116
120117 fetchCycle ( ) ; // Load on mount
121118
122- const interval = setInterval ( fetchCycle , 60000 ) ; // Poll every 60 seconds
119+ const interval = setInterval ( fetchCycle , 300000 ) ; // Poll every 5 min
120+ // Optionally fetch when tab becomes visible again
121+ const handleVisibilityChange = ( ) => {
122+ if ( document . visibilityState === 'visible' ) {
123+ fetchCycle ( ) ;
124+ }
125+ } ;
126+ document . addEventListener ( 'visibilitychange' , handleVisibilityChange ) ;
123127
124- return ( ) => clearInterval ( interval ) ; // Cleanup
128+ return ( ) => {
129+ clearInterval ( interval ) ;
130+ document . removeEventListener ( 'visibilitychange' , handleVisibilityChange ) ;
131+ } ;
125132 } , [ ] ) ;
126133
127134 return (
You can’t perform that action at this time.
0 commit comments