File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ function SettingEmailRow({
22
22
} : SettingEmailRowProps ) {
23
23
const [ edit , setEdit ] = useState ( false ) ;
24
24
const [ value , onChange ] = useInput ( email ?? '' ) ;
25
+ const [ isLoading , setIsLoading ] = useState ( false ) ;
25
26
26
27
const onSubmit = async ( e : React . FormEvent ) => {
27
28
e . preventDefault ( ) ;
@@ -36,6 +37,7 @@ function SettingEmailRow({
36
37
return ;
37
38
}
38
39
40
+ setIsLoading ( true ) ;
39
41
const response = await client . query < { emailExists : boolean } > ( {
40
42
query : EMAIL_EXISTS ,
41
43
fetchPolicy : 'network-only' ,
@@ -44,11 +46,13 @@ function SettingEmailRow({
44
46
45
47
if ( response . data . emailExists ) {
46
48
toast . error ( '동일한 이메일이 존재합니다.' ) ;
49
+ setIsLoading ( false ) ;
47
50
return ;
48
51
}
49
52
50
53
await onChangeEmail ( value ) ;
51
54
setEdit ( false ) ;
55
+ setIsLoading ( false ) ;
52
56
} ;
53
57
54
58
return (
@@ -66,8 +70,9 @@ function SettingEmailRow({
66
70
value = { value }
67
71
onChange = { onChange }
68
72
placeholder = "이메일"
73
+ disabled = { isLoading }
69
74
/>
70
- < Button > 변경</ Button >
75
+ < Button disabled = { isLoading } > 변경</ Button >
71
76
</ Form >
72
77
) : isEmailSent ? (
73
78
< SettingEmailSuccess />
You can’t perform that action at this time.
0 commit comments