Skip to content

Commit

Permalink
navigate back to home after delete
Browse files Browse the repository at this point in the history
  • Loading branch information
swh00tw committed Jul 2, 2022
1 parent 737d621 commit dc5b23c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/containers/UserInfoContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function DeleteDialog({ isAlertOpen, setIsAlertOpen, deleteMode, setDeleteMode }
const cancelRef = useRef();
const toast = useToast();
const { user, logout, getAccessTokenSilently } = useAuth0();
const navigate = useNavigate();

const [confirm, setConfirm] = useState("");
const [isDeleting, setIsDeleting] = useState(false);
Expand Down Expand Up @@ -127,6 +128,7 @@ function DeleteDialog({ isAlertOpen, setIsAlertOpen, deleteMode, setDeleteMode }
setIsDeleting(true);
if (deleteMode === "User Profile") {
await clearUserProfile();
navigate("/");
onClose();
} else if (deleteMode === "User Account") {
await clearUserAccount();
Expand Down

0 comments on commit dc5b23c

Please sign in to comment.