Skip to content

Commit 52f9c44

Browse files
committed
Merge release into dev - synchronize branches
2 parents b477ed2 + b21320f commit 52f9c44

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/app/component.js

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

106106
// Home page needs predictions and sparse data for the map
107-
// Fetch years, predictions, and available states immediately
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
108109
if (isHomePage) {
109110
getAvailableYears();
110-
getPredictions(predictionYear);
111-
getAvailableStates({ predictionYear });
112111
}
113112

114113
// Blog pages need blog posts
@@ -125,7 +124,6 @@ const App = (props) => {
125124
getAggregateStateData,
126125
getAggregateYearData,
127126
getAllBlogPosts,
128-
getAvailableStates,
129127
getAvailableYears,
130128
getPredictions,
131129
getSparseData,

src/components/loader/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import React from 'react';
1+
import React, { useRef } 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+
79
const spinnerContent = (
810
<div className={inline ? 'loading-container loading-container--inline' : 'loading-container'}>
911
<div className="loading-spinner">
@@ -21,7 +23,7 @@ const Loader = ({ visible, message = 'Loading...', inline = false }) => {
2123

2224
return (
2325
<Modal
24-
key={visible ? 'loader-open' : 'loader-closed'}
26+
key={modalIdRef.current}
2527
ariaHideApp={false}
2628
className="loading-modal"
2729
closeTimeoutMS={200}

0 commit comments

Comments
 (0)