Skip to content

Commit 46e23d1

Browse files
Merge pull request #2240 from frankeros/bug-bash
Added isSaving state to disabled prop of save btn
2 parents 0b2f82d + 365dae0 commit 46e23d1

File tree

1 file changed

+7
-1
lines changed
  • src/shared/components/Settings/Profile/BasicInfo

1 file changed

+7
-1
lines changed

src/shared/components/Settings/Profile/BasicInfo/index.jsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export default class BasicInfo extends ConsentComponent {
7373
competitionCountryCode: null,
7474
photoURL: '',
7575
tracks: [],
76+
isSaving: false,
7677
},
7778
};
7879
}
@@ -171,8 +172,10 @@ export default class BasicInfo extends ConsentComponent {
171172
*/
172173
onHandleSaveBasicInfo(e) {
173174
e.preventDefault();
175+
this.setState({ isSaving: true });
174176
const { newBasicInfo } = this.state;
175177
if (this.onCheckFormValue(newBasicInfo)) {
178+
this.setState({ isSaving: false });
176179
return;
177180
}
178181
this.showConsent(this.onSaveBasicInfo.bind(this));
@@ -233,6 +236,8 @@ export default class BasicInfo extends ConsentComponent {
233236
await updateUserTrait(handle, 'personalization', [personalizationData], tokenV3);
234237
}
235238
}
239+
240+
this.setState({ isSaving: false });
236241
}
237242

238243
onUpdateSelect(option) {
@@ -458,6 +463,7 @@ export default class BasicInfo extends ConsentComponent {
458463
newBasicInfo,
459464
formInvalid,
460465
errorMessage,
466+
isSaving,
461467
} = this.state;
462468

463469
return (
@@ -911,7 +917,7 @@ export default class BasicInfo extends ConsentComponent {
911917
<div styleName="button-save">
912918
<PrimaryButton
913919
styleName="white-label"
914-
disabled={false}
920+
disabled={isSaving}
915921
onClick={this.onHandleSaveBasicInfo}
916922
>
917923
{

0 commit comments

Comments
 (0)