File tree 1 file changed +7
-1
lines changed
src/shared/components/Settings/Profile/BasicInfo
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ export default class BasicInfo extends ConsentComponent {
73
73
competitionCountryCode : null ,
74
74
photoURL : '' ,
75
75
tracks : [ ] ,
76
+ isSaving : false ,
76
77
} ,
77
78
} ;
78
79
}
@@ -171,8 +172,10 @@ export default class BasicInfo extends ConsentComponent {
171
172
*/
172
173
onHandleSaveBasicInfo ( e ) {
173
174
e . preventDefault ( ) ;
175
+ this . setState ( { isSaving : true } ) ;
174
176
const { newBasicInfo } = this . state ;
175
177
if ( this . onCheckFormValue ( newBasicInfo ) ) {
178
+ this . setState ( { isSaving : false } ) ;
176
179
return ;
177
180
}
178
181
this . showConsent ( this . onSaveBasicInfo . bind ( this ) ) ;
@@ -233,6 +236,8 @@ export default class BasicInfo extends ConsentComponent {
233
236
await updateUserTrait ( handle , 'personalization' , [ personalizationData ] , tokenV3 ) ;
234
237
}
235
238
}
239
+
240
+ this . setState ( { isSaving : false } ) ;
236
241
}
237
242
238
243
onUpdateSelect ( option ) {
@@ -458,6 +463,7 @@ export default class BasicInfo extends ConsentComponent {
458
463
newBasicInfo,
459
464
formInvalid,
460
465
errorMessage,
466
+ isSaving,
461
467
} = this . state ;
462
468
463
469
return (
@@ -911,7 +917,7 @@ export default class BasicInfo extends ConsentComponent {
911
917
< div styleName = "button-save" >
912
918
< PrimaryButton
913
919
styleName = "white-label"
914
- disabled = { false }
920
+ disabled = { isSaving }
915
921
onClick = { this . onHandleSaveBasicInfo }
916
922
>
917
923
{
You can’t perform that action at this time.
0 commit comments