diff --git a/src/app/pages/directory-service/components/active-directory/active-directory.component.ts b/src/app/pages/directory-service/components/active-directory/active-directory.component.ts index dd32809ca9f..a7f4a431e8e 100644 --- a/src/app/pages/directory-service/components/active-directory/active-directory.component.ts +++ b/src/app/pages/directory-service/components/active-directory/active-directory.component.ts @@ -96,20 +96,25 @@ export class ActiveDirectoryComponent implements OnInit { onRebuildCachePressed(): void { this.isLoading = true; - this.systemGeneralService.refreshDirServicesCache().pipe(untilDestroyed(this)).subscribe({ - next: () => { - this.isLoading = false; - this.snackbarService.success( - this.translate.instant(helptextActiveDirectory.activedirectory_custactions_clearcache_dialog_message), - ); - this.cdr.markForCheck(); - }, - error: (error: unknown) => { - this.isLoading = false; - this.dialogService.error(this.errorHandler.parseError(error)); - this.cdr.markForCheck(); - }, - }); + this.dialogService + .jobDialog(this.systemGeneralService.refreshDirServicesCache()) + .afterClosed() + .pipe(untilDestroyed(this)).subscribe({ + next: ({ description }) => { + this.isLoading = false; + this.snackbarService.success( + this.translate.instant( + description || helptextActiveDirectory.activedirectory_custactions_clearcache_dialog_message, + ), + ); + this.cdr.markForCheck(); + }, + error: (error: unknown) => { + this.isLoading = false; + this.dialogService.error(this.errorHandler.parseError(error)); + this.cdr.markForCheck(); + }, + }); } onLeaveDomainPressed(): void { diff --git a/src/app/pages/directory-service/components/ldap/ldap.component.ts b/src/app/pages/directory-service/components/ldap/ldap.component.ts index e6ac0f811a5..738abc5ebc4 100644 --- a/src/app/pages/directory-service/components/ldap/ldap.component.ts +++ b/src/app/pages/directory-service/components/ldap/ldap.component.ts @@ -90,20 +90,23 @@ export class LdapComponent implements OnInit { onRebuildCachePressed(): void { this.isLoading = true; - this.systemGeneralService.refreshDirServicesCache().pipe(untilDestroyed(this)).subscribe({ - next: () => { - this.isLoading = false; - this.snackbar.success( - this.translate.instant(helptextLdap.ldap_custactions_clearcache_dialog_message), - ); - this.cdr.markForCheck(); - }, - error: (error: unknown) => { - this.isLoading = false; - this.dialogService.error(this.errorHandler.parseError(error)); - this.cdr.markForCheck(); - }, - }); + this.dialogService + .jobDialog(this.systemGeneralService.refreshDirServicesCache()) + .afterClosed() + .pipe(untilDestroyed(this)).subscribe({ + next: ({ description }) => { + this.isLoading = false; + this.snackbar.success( + this.translate.instant(description || helptextLdap.ldap_custactions_clearcache_dialog_message), + ); + this.cdr.markForCheck(); + }, + error: (error: unknown) => { + this.isLoading = false; + this.dialogService.error(this.errorHandler.parseError(error)); + this.cdr.markForCheck(); + }, + }); } onSubmit(): void {