aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/views/settings/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/settings/index.tsx
parentde0c85ca334d06f042e685b8263a3261b8f8b055 (diff)
downloadtimeline-2d9ef25d6171890496b1c9dd48a91b11c40eca7c.tar.gz
timeline-2d9ef25d6171890496b1c9dd48a91b11c40eca7c.tar.bz2
timeline-2d9ef25d6171890496b1c9dd48a91b11c40eca7c.zip
...
Diffstat (limited to 'FrontEnd/src/views/settings/index.tsx')
-rw-r--r--FrontEnd/src/views/settings/index.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/FrontEnd/src/views/settings/index.tsx b/FrontEnd/src/views/settings/index.tsx
index b9a8209b..86a8b263 100644
--- a/FrontEnd/src/views/settings/index.tsx
+++ b/FrontEnd/src/views/settings/index.tsx
@@ -1,5 +1,5 @@
import React, { useState } from "react";
-import { useHistory } from "react-router";
+import { useNavigate } from "react-router-dom";
import { useTranslation } from "react-i18next";
import { useUser, userService } from "@/services/user";
@@ -15,7 +15,7 @@ import "./index.css";
const SettingsPage: React.FC = (_) => {
const { i18n, t } = useTranslation();
const user = useUser();
- const history = useHistory();
+ const navigate = useNavigate();
const [dialog, setDialog] = useState<
null | "changepassword" | "changeavatar" | "changenickname" | "logout"
@@ -95,7 +95,7 @@ const SettingsPage: React.FC = (_) => {
open={dialog === "logout"}
onConfirm={() => {
void userService.logout().then(() => {
- history.push("/");
+ navigate("/");
});
}}
/>