diff --git a/apps/proxy-auth/src/app/otp/send-otp/send-otp.component.html b/apps/proxy-auth/src/app/otp/send-otp/send-otp.component.html index 30251e04..c49b891f 100644 --- a/apps/proxy-auth/src/app/otp/send-otp/send-otp.component.html +++ b/apps/proxy-auth/src/app/otp/send-otp/send-otp.component.html @@ -7,7 +7,8 @@ 'dark-theme': (theme === 'dark' && (type === 'user-management' || authToken)) || type === 'organization-details', 'user-profile-mode': - authToken && type !== 'user-management' && type !== 'subscription' && type !== 'organization-details' + authToken && type !== 'user-management' && type !== 'subscription' && type !== 'organization-details', + 'user-management': authToken && type === 'user-management' }" >
= this.componentStore.updatePaymentDetails$; public webhookEvents$: Observable = this.componentStore.webhookEvents$; public uploadLogo$: Observable = this.componentStore.uploadLogo$; + public errorInUploadLogo$: Observable = this.componentStore.errorInUploadLogo$; public isEditMode = false; public previewInputPosition: 'top' | 'bottom' = 'top'; public selectedServiceIndex = 0; @@ -585,6 +586,12 @@ export class CreateFeatureComponent extends BaseComponent implements OnDestroy, this.isLogoUploading = false; this.cdr.markForCheck(); }); + this.errorInUploadLogo$.pipe(filter(Boolean), takeUntil(this.destroy$)).subscribe((error) => { + if (error) { + this.isLogoUploading = false; + } + this.cdr.markForCheck(); + }); } public validateFirstStepAndNext(nameControl: AbstractControl): void { diff --git a/apps/proxy/src/app/features/create-feature/create-feature.store.ts b/apps/proxy/src/app/features/create-feature/create-feature.store.ts index c0afe600..2b1e8b7c 100644 --- a/apps/proxy/src/app/features/create-feature/create-feature.store.ts +++ b/apps/proxy/src/app/features/create-feature/create-feature.store.ts @@ -30,6 +30,7 @@ export interface ICreateFeatureInitialState { updatePaymentDetails: any; webhookEvents: any; uploadLogo: any; + errorInUploadLogo: boolean; } @Injectable() @@ -60,6 +61,7 @@ export class CreateFeatureComponentStore extends ComponentStore = this.select((state) => state.webhookEvents); /** Selector for upload logo data */ readonly uploadLogo$: Observable = this.select((state) => state.uploadLogo); + /** Selector for error in upload logo data */ + readonly errorInUploadLogo$: Observable = this.select((state) => state.errorInUploadLogo); /** Get feature type data */ readonly getFeatureType = this.effect((data) => { return data.pipe( @@ -697,7 +701,7 @@ export class CreateFeatureComponentStore extends ComponentStore) => { return data.pipe( switchMap((req) => { - this.patchState({ isLoading: true, uploadLogo: null }); + this.patchState({ isLoading: true, uploadLogo: null, errorInUploadLogo: false }); return this.service.uploadLogo(req.id, req.formData).pipe( tapResponse( (res: BaseResponse) => { @@ -710,7 +714,7 @@ export class CreateFeatureComponentStore extends ComponentStore { this.showError(error.errors); - this.patchState({ isLoading: false }); + this.patchState({ isLoading: false, errorInUploadLogo: true }); } ), catchError((err) => EMPTY)