diff --git a/frontend/app/framework/angular/forms/confirm-click.directive.ts b/frontend/app/framework/angular/forms/confirm-click.directive.ts index 2c317ef7c..0cf20d3e4 100644 --- a/frontend/app/framework/angular/forms/confirm-click.directive.ts +++ b/frontend/app/framework/angular/forms/confirm-click.directive.ts @@ -44,20 +44,17 @@ export class ConfirmClickDirective { this.confirmTitle.length > 0 && this.confirmText && this.confirmText.length > 0) { - const observers = [...this.clickConfirmed.observers]; - this.beforeClick.emit(); + const destinations = + this.clickConfirmed.observers?.map(x => (x as Subscriber)['destination']) || []; + this.dialogs.confirm(this.confirmTitle, this.confirmText, this.confirmRememberKey).pipe(take(1)) .subscribe(confirmed => { if (confirmed) { - for (const observer of observers) { - const subscriber = observer as Subscriber; - - const internal = (subscriber as any).destination; - - if (Types.isFunction(internal.next)) { - internal.next(true); + for (const destination of destinations) { + if (Types.isFunction(destination?.next)) { + destination.next(true); } } }