Skip to content

Commit

Permalink
fix(subscription): country and massif page not working when not logged
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarseguerra committed Oct 7, 2024
1 parent 4058d69 commit 17016f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/web-app/src/pages/Country/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ const CountryPage = () => {

useEffect(() => {
dispatch(fetchCountry(countryId));
if (userProperties) {
if (permissions.isAuth) {
dispatch(fetchSubscriptions(userProperties.id));
}
}, [dispatch, countryId, userProperties]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [dispatch, countryId]);

return (
<Country
Expand Down
5 changes: 3 additions & 2 deletions packages/web-app/src/pages/Massif/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ const MassifPage = () => {
// Initial data fetch
useEffect(() => {
dispatch(loadMassif(massifId));
if (userProperties) {
if (permissions.isAuth) {
dispatch(fetchSubscriptions(userProperties.id));
}
}, [massifId, userProperties, dispatch]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [massifId, dispatch]);

return massif?.isDeleted && !permissions.isModerator ? (
<Deleted entityType={DELETED_ENTITIES.massif} entity={massif} />
Expand Down

0 comments on commit 17016f0

Please sign in to comment.