bug: clear redux store on logout

closes #372
This commit is contained in:
2023-02-28 19:33:47 +00:00
parent f30a9075a2
commit ac41f8c2f4
3 changed files with 3 additions and 5 deletions

View File

@ -1,5 +1,4 @@
import { useDispatch } from "react-redux";
import { useNavigate } from "react-router-dom";
import { FormattedMessage } from "react-intl";
import { logout } from "State/Login";
@ -8,14 +7,13 @@ import messages from "./messages";
export default function LogoutButton() {
const dispatch = useDispatch();
const navigate = useNavigate();
return (
<button
className="secondary"
type="button"
onClick={() => {
dispatch(logout());
navigate("/");
window.location.href = "/";
}}>
<FormattedMessage {...messages.Logout} />
</button>