|
|
@ -44,20 +44,17 @@ export class ConfirmClickDirective { |
|
|
this.confirmTitle.length > 0 && |
|
|
this.confirmTitle.length > 0 && |
|
|
this.confirmText && |
|
|
this.confirmText && |
|
|
this.confirmText.length > 0) { |
|
|
this.confirmText.length > 0) { |
|
|
const observers = [...this.clickConfirmed.observers]; |
|
|
|
|
|
|
|
|
|
|
|
this.beforeClick.emit(); |
|
|
this.beforeClick.emit(); |
|
|
|
|
|
|
|
|
|
|
|
const destinations = |
|
|
|
|
|
this.clickConfirmed.observers?.map(x => (x as Subscriber<any>)['destination']) || []; |
|
|
|
|
|
|
|
|
this.dialogs.confirm(this.confirmTitle, this.confirmText, this.confirmRememberKey).pipe(take(1)) |
|
|
this.dialogs.confirm(this.confirmTitle, this.confirmText, this.confirmRememberKey).pipe(take(1)) |
|
|
.subscribe(confirmed => { |
|
|
.subscribe(confirmed => { |
|
|
if (confirmed) { |
|
|
if (confirmed) { |
|
|
for (const observer of observers) { |
|
|
for (const destination of destinations) { |
|
|
const subscriber = observer as Subscriber<any>; |
|
|
if (Types.isFunction(destination?.next)) { |
|
|
|
|
|
destination.next(true); |
|
|
const internal = (subscriber as any).destination; |
|
|
|
|
|
|
|
|
|
|
|
if (Types.isFunction(internal.next)) { |
|
|
|
|
|
internal.next(true); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|