Skip to content

Commit 827786d

Browse files
committed
Merge branch 'fix/imporve-map-filters' into dev
2 parents 52f9c44 + d9b94db commit 827786d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/app/component.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,11 @@ const App = (props) => {
104104
const isResultsPage = pathname === '/observed-outcomes';
105105

106106
// Home page needs predictions and sparse data for the map
107-
// First fetch available years to ensure predictionYear is valid (e.g., 2024 not 2025)
108-
// The reducer will auto-correct predictionYear, which triggers the other useEffect to fetch predictions
107+
// Fetch years, predictions, and available states immediately
109108
if (isHomePage) {
110109
getAvailableYears();
110+
getPredictions(predictionYear);
111+
getAvailableStates({ predictionYear });
111112
}
112113

113114
// Blog pages need blog posts
@@ -124,6 +125,7 @@ const App = (props) => {
124125
getAggregateStateData,
125126
getAggregateYearData,
126127
getAllBlogPosts,
128+
getAvailableStates,
127129
getAvailableYears,
128130
getPredictions,
129131
getSparseData,

src/components/loader/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import React, { useRef } from 'react';
1+
import React from 'react';
22
import Modal from 'react-modal';
33

44
import './style.scss';
55

66
const Loader = ({ visible, message = 'Loading...', inline = false }) => {
7-
const modalIdRef = useRef(`loader-modal-${Math.random().toString(36).substring(2, 11)}`);
8-
97
const spinnerContent = (
108
<div className={inline ? 'loading-container loading-container--inline' : 'loading-container'}>
119
<div className="loading-spinner">
@@ -23,7 +21,7 @@ const Loader = ({ visible, message = 'Loading...', inline = false }) => {
2321

2422
return (
2523
<Modal
26-
key={modalIdRef.current}
24+
key={visible ? 'loader-open' : 'loader-closed'}
2725
ariaHideApp={false}
2826
className="loading-modal"
2927
closeTimeoutMS={200}

0 commit comments

Comments
 (0)