aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/views/user/index.tsx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-12-06 20:46:35 +0800
committercrupest <crupest@outlook.com>2021-12-06 20:46:35 +0800
commit2d9ef25d6171890496b1c9dd48a91b11c40eca7c (patch)
treeac48193d08296dd880005e8e0399b0b48a4bcc5d /FrontEnd/src/views/user/index.tsx
parentde0c85ca334d06f042e685b8263a3261b8f8b055 (diff)
downloadtimeline-2d9ef25d6171890496b1c9dd48a91b11c40eca7c.tar.gz
timeline-2d9ef25d6171890496b1c9dd48a91b11c40eca7c.tar.bz2
timeline-2d9ef25d6171890496b1c9dd48a91b11c40eca7c.zip
...
Diffstat (limited to 'FrontEnd/src/views/user/index.tsx')
-rw-r--r--FrontEnd/src/views/user/index.tsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/FrontEnd/src/views/user/index.tsx b/FrontEnd/src/views/user/index.tsx
index 70b4f60f..7913b788 100644
--- a/FrontEnd/src/views/user/index.tsx
+++ b/FrontEnd/src/views/user/index.tsx
@@ -1,13 +1,19 @@
import React from "react";
-import { useParams } from "react-router";
+import { useParams } from "react-router-dom";
import TimelinePageTemplate from "../timeline-common/TimelinePageTemplate";
import UserCard from "./UserCard";
+import { UiLogicError } from "@/common";
+
import "./index.css";
const UserPage: React.FC = () => {
- const { username } = useParams<{ username: string }>();
+ const { username } = useParams();
+
+ if (username == null) {
+ throw new UiLogicError("No route param 'username'.");
+ }
const [reloadKey, setReloadKey] = React.useState<number>(0);