refactor: re-login modal

This commit is contained in:
Tristan Yang
2023-03-22 11:33:14 +08:00
parent dba894c7e4
commit 5da75d4c9f
3 changed files with 41 additions and 33 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import Button from "../../common/component/styled/Button";
import useLogout from "../../common/hook/useLogout";
import { useTranslation } from "react-i18next";
import { useDispatch } from "react-redux";
import { resetRoleChanged } from "../../app/slices/auth.data";
import { updateRoleChanged } from "../../app/slices/auth.data";
interface Props {
reasonType?: "role_changed",
@@ -21,7 +21,7 @@ const ReLoginModal: FC<Props> = ({ reasonType = "role_changed" }) => {
logout();
};
const handleReset = () => {
dispatch(resetRoleChanged());
dispatch(updateRoleChanged(false));
};
useEffect(() => {
if (exited) {