File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
atcoder-problems-frontend/src/pages/Internal/MyAccountPage Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -17,20 +17,18 @@ import { updateUserInfo } from "./ApiClient";
17
17
18
18
export const MyAccountPage = ( ) : JSX . Element => {
19
19
const loginState = useLoginState ( ) ;
20
- const [ isUpdating , setIsUpdating ] = useState ( false ) ;
21
- const [ isValidResponse , setIsValidResponse ] = useState < boolean > ( ) ;
22
20
23
21
const [ userId , setUserId ] = useState ( "" ) ;
22
+ const [ isUpdating , setIsUpdating ] = useState ( false ) ;
23
+ const [ isValidResponse , setIsValidResponse ] = useState < boolean > ( ) ;
24
24
const { path } = useRouteMatch ( ) ;
25
25
const { pathname } = useLocation ( ) ;
26
26
27
27
const handleSubmit = async ( userId : string ) => {
28
28
setIsUpdating ( true ) ;
29
-
30
29
await updateUserInfo ( userId ) . then ( ( response ) => {
31
30
setIsValidResponse ( response . status === 200 ) ;
32
31
} ) ;
33
-
34
32
setIsUpdating ( false ) ;
35
33
} ;
36
34
@@ -91,7 +89,7 @@ export const MyAccountPage = (): JSX.Element => {
91
89
< UserIdUpdate
92
90
userId = { userId }
93
91
setUserId = { setUserId }
94
- onSubmit = { async ( ) => handleSubmit ( userId ) }
92
+ onSubmit = { ( ) => handleSubmit ( userId ) }
95
93
status = { isUpdating ? "updating" : updated ? "updated" : "open" }
96
94
/>
97
95
</ Route >
You can’t perform that action at this time.
0 commit comments