Skip to content

Commit

Permalink
proper async call to fetch user info in statistics, fixes #566
Browse files Browse the repository at this point in the history
  • Loading branch information
ferishili committed Jun 4, 2024
1 parent eed6331 commit b968397
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/statistics/Statistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Header from "../Header";
import Footer from "../Footer";
import MainNav from "../shared/MainNav";
import TimeSeriesStatistics from "../shared/TimeSeriesStatistics";
import { addNotification } from "../../slices/notificationSlice";
import {
getStatistics,
hasStatistics as getHasStatistics,
Expand Down Expand Up @@ -46,10 +47,9 @@ const Statistics: React.FC = () => {

useEffect(() => {
// fetch user information for organization id, then fetch statistics
// @ts-expect-error TS(7006): Parameter 'e' implicitly has an 'any' type.
fetchUserInfo().then((e) => {
dispatch(fetchUserInfo()).then(() => {
dispatch(fetchStatisticsPageStatistics(organizationId)).then();
});
})
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

Expand Down

0 comments on commit b968397

Please sign in to comment.