refactor: optional route

This commit is contained in:
Tristan Yang
2022-12-26 17:45:49 +08:00
parent c8a75b4e1b
commit 776b405781
2 changed files with 1 additions and 5 deletions
+1 -4
View File
@@ -87,10 +87,7 @@ const PageRoutes = () => {
}
>
<Route index element={<LazyIt><RegPage /></LazyIt>} />
<Route path="set_name">
<Route index element={<LazyIt><RegWithUsernamePage /></LazyIt>} />
<Route path=":from" element={<LazyIt><RegWithUsernamePage /></LazyIt>} />
</Route>
<Route path="set_name/:from?" element={<LazyIt><RegWithUsernamePage /></LazyIt>} />
</Route>
<Route
path="/email_login"
-1
View File
@@ -25,7 +25,6 @@ const RegWithUsername: FC = () => {
const dispatch = useDispatch();
const [username, setUsername] = useState("");
const query = new URLSearchParams(location.search);
// const githubCode = query.get("gcode");
// todo: check if query param exists
const token = query.get("magic_token") as string;
useEffect(() => {