#21 Cleanup
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { 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 { makeRequest } from "../utils.ts";
|
||||
|
||||
@@ -12,6 +12,7 @@ const RegisterPage = () => {
|
||||
const [password2, setPassword2] = useState("");
|
||||
|
||||
const [error, setError] = useState(null);
|
||||
const [location, setLocation] = useLocation();
|
||||
|
||||
const sendRegisterRequest = (e) => {
|
||||
e?.preventDefault();
|
||||
@@ -32,7 +33,7 @@ const RegisterPage = () => {
|
||||
setError(data);
|
||||
return;
|
||||
}
|
||||
window.location.href = "/login";
|
||||
setLocation("/login");
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user