Skip to content

Commit

Permalink
fix: Reload group data after logout
Browse files Browse the repository at this point in the history
  • Loading branch information
josebui committed Feb 19, 2024
1 parent b1fd3a3 commit b1cd663
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/group/components/GroupView.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ const GroupView = () => {
const { t } = useTranslation();
const navigate = useNavigate();
const { setRefreshing } = useRefreshProgressContext();
const hasToken = useSelector(state => state.account.hasToken);
const { group, fetching, refreshing } = useSelector(
state => state.group.view
);
Expand Down Expand Up @@ -186,7 +187,9 @@ const GroupView = () => {
)
);

useFetchData(useCallback(() => fetchGroupView(slug), [slug]));
// Ignore eslint to force reloading data after logout
// eslint-disable-next-line react-hooks/exhaustive-deps
useFetchData(useCallback(() => fetchGroupView(slug), [slug, hasToken]));

const updateGroup = useCallback(() => {
dispatch(refreshGroupView(slug));
Expand Down

0 comments on commit b1cd663

Please sign in to comment.