Skip to content

Commit 7bdc0f2

Browse files
committed
fix
1 parent 22122d5 commit 7bdc0f2

File tree

1 file changed

+3
-5
lines changed
  • atcoder-problems-frontend/src/pages/Internal/MyAccountPage

1 file changed

+3
-5
lines changed

atcoder-problems-frontend/src/pages/Internal/MyAccountPage/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,18 @@ import { updateUserInfo } from "./ApiClient";
1717

1818
export const MyAccountPage = (): JSX.Element => {
1919
const loginState = useLoginState();
20-
const [isUpdating, setIsUpdating] = useState(false);
21-
const [isValidResponse, setIsValidResponse] = useState<boolean>();
2220

2321
const [userId, setUserId] = useState("");
22+
const [isUpdating, setIsUpdating] = useState(false);
23+
const [isValidResponse, setIsValidResponse] = useState<boolean>();
2424
const { path } = useRouteMatch();
2525
const { pathname } = useLocation();
2626

2727
const handleSubmit = async (userId: string) => {
2828
setIsUpdating(true);
29-
3029
await updateUserInfo(userId).then((response) => {
3130
setIsValidResponse(response.status === 200);
3231
});
33-
3432
setIsUpdating(false);
3533
};
3634

@@ -91,7 +89,7 @@ export const MyAccountPage = (): JSX.Element => {
9189
<UserIdUpdate
9290
userId={userId}
9391
setUserId={setUserId}
94-
onSubmit={async () => handleSubmit(userId)}
92+
onSubmit={() => handleSubmit(userId)}
9593
status={isUpdating ? "updating" : updated ? "updated" : "open"}
9694
/>
9795
</Route>

0 commit comments

Comments
 (0)