Skip to content

Commit aaf00fc

Browse files
committed
fix(arc-saas): disable button after submit
GH-73
1 parent 55ac3f1 commit aaf00fc

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

projects/saas-ui/src/app/main/components/tenant-registration/tenant-registration.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ <h5>{{ plan.name }}</h5>
358358
nbButton
359359
size="medium"
360360
status="danger"
361-
[disabled]="!tenantRegForm.valid"
361+
[disabled]="!tenantRegForm.valid || isSubmitting"
362362
type="submit"
363363
>
364364
Submit

projects/saas-ui/src/app/main/components/tenant-registration/tenant-registration.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export class TenantRegistrationComponent {
3737
subscriptionPlans: AnyObject[];
3838
leadId = '';
3939
countryOptions = COUNTRIES;
40+
isSubmitting = false;
4041

4142
constructor(
4243
private route: ActivatedRoute,
@@ -121,6 +122,7 @@ export class TenantRegistrationComponent {
121122

122123
onSubmit() {
123124
if (this.tenantRegForm.valid) {
125+
this.isSubmitting = true;
124126
const userData = this.tenantRegForm.value;
125127
const user: TenantLeadWithPaymentMethod = {
126128
name: userData.name,
@@ -142,6 +144,7 @@ export class TenantRegistrationComponent {
142144
this.onBoardingService.registerTenant(user).subscribe(
143145
() => {
144146
this.toastrService.show('Tenant Added , successfully');
147+
this.isSubmitting = false;
145148
this.router.navigate(['main/onboard-tenant-list']);
146149
},
147150
(error: string) => {

0 commit comments

Comments
 (0)