#21 Cleanup
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { useContext, useEffect, useState } from "react";
|
||||
import { Button, Col, Container, Form, Row, Alert } from "react-bootstrap";
|
||||
import { Link } from "wouter";
|
||||
import { Link, useLocation } from "wouter";
|
||||
import MyNavbar from "../components/MyNavbar";
|
||||
import UserContext from "../contexts/UserContext";
|
||||
import { makeRequest } from "../utils.ts";
|
||||
@@ -11,6 +11,7 @@ const LoginPage = () => {
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
const { currentUser, setCurrentUser } = useContext(UserContext);
|
||||
const [location, setLocation] = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
if (currentUser?.id) {
|
||||
@@ -19,7 +20,7 @@ const LoginPage = () => {
|
||||
}, [currentUser]);
|
||||
|
||||
const gotoHome = () => {
|
||||
window.location.href = "/";
|
||||
setLocation("/");
|
||||
};
|
||||
|
||||
const sendLoginRequest = async (e) => {
|
||||
|
||||
Reference in New Issue
Block a user