diff --git a/src/components/LogoutButton/LogoutButton.tsx b/src/components/LogoutButton/LogoutButton.tsx index 4ccb9bd..1fdfd19 100644 --- a/src/components/LogoutButton/LogoutButton.tsx +++ b/src/components/LogoutButton/LogoutButton.tsx @@ -1,21 +1,18 @@ import React, { FC, memo, useCallback } from "react" -import { useDispatch, useSelector } from "react-redux" +import { useSelector } from "react-redux" import { unsetJWT } from "../../services/auth" -import { isUserConnected, logoutUser } from "../../store/auth" +import { isUserConnected } from "../../store/auth" import styles from "./styles.module.scss" const LogoutButton: FC = (): JSX.Element | null => { - const dispatch = useDispatch() const connected = useSelector(isUserConnected) - const onClick = useCallback( - (event: React.SyntheticEvent): void => { - event.preventDefault() - unsetJWT() - dispatch(logoutUser()) - }, - [dispatch] - ) + const onClick = useCallback((event: React.SyntheticEvent): void => { + event.preventDefault() + unsetJWT() + // eslint-disable-next-line no-restricted-globals + location?.reload() + }, []) if (!connected) return null diff --git a/src/components/Notifications/index.tsx b/src/components/Notifications/index.tsx index 35fee67..9524dc0 100644 --- a/src/components/Notifications/index.tsx +++ b/src/components/Notifications/index.tsx @@ -7,7 +7,7 @@ import styles from "./styles.module.scss" import { selectUserJwtToken } from "../../store/auth" import { VolunteerNotifs } from "../../services/volunteers" import LogoutButton from "../LogoutButton/LogoutButton" -import { TeamWishesForm } from ".." +// import { TeamWishesForm } from ".." import { fetchFor as fetchForTeamWishesForm } from "../VolunteerBoard/TeamWishesForm/TeamWishesForm" interface Props { @@ -144,25 +144,25 @@ const Notifications = ({ volunteerNotifs }: Props): JSX.Element | null => { ) } - const onSubmit3 = useCallback((): void => { - dispatch( - fetchVolunteerNotifsSet(jwtToken, 0, { - hiddenNotifs: [...(volunteerNotifs?.hiddenNotifs || []), 3], - }) - ) - }, [dispatch, jwtToken, volunteerNotifs]) + // const onSubmit3 = useCallback((): void => { + // dispatch( + // fetchVolunteerNotifsSet(jwtToken, 0, { + // hiddenNotifs: [...(volunteerNotifs?.hiddenNotifs || []), 3], + // }) + // ) + // }, [dispatch, jwtToken, volunteerNotifs]) - if (!_.includes(hidden, 3)) { - notifs.push( -