The Geocore application found at app.geo.ca is an open source react application created to explore the geocore geospatial library. | L'application Geocore disponible sur app.geo.ca est une application de réaction open source créée pour explorer la bibliothèque géospatiale geocore.
Line 16 in dashboard.ts, switch(+dc), + is not necessary for enum
Duplicate api calls is observed when dashboard component is first time rendered. The reason is both userID and language changes triggered. As a workaround, the language can be moved outside the component an pass in thru props (from dashboard-panel). Or we can use locale context (but I don't see context used in general app). So we don't need two useEffect hooks.
In dashboard component, the function inside useEffect (both getAnnouncement and getCommunityAndSavedRecords) has dependency in both userID and language. In that sense, the function itself should be in the useEffect dependency list as well.
That means, the function needs to be wrapped in useCallback. (this is recommended by eslint rule: react-hooks/exhaustive-deps)
Code to add