diff options
Diffstat (limited to 'client/src/app/core/confirm')
-rw-r--r-- | client/src/app/core/confirm/confirm.service.ts | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/client/src/app/core/confirm/confirm.service.ts b/client/src/app/core/confirm/confirm.service.ts index 6e042c16b..338b8762c 100644 --- a/client/src/app/core/confirm/confirm.service.ts +++ b/client/src/app/core/confirm/confirm.service.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import { first } from 'rxjs/operators' | 1 | import { firstValueFrom, Subject } from 'rxjs' |
2 | import { Injectable } from '@angular/core' | 2 | import { Injectable } from '@angular/core' |
3 | import { Subject } from 'rxjs' | ||
4 | 3 | ||
5 | type ConfirmOptions = { | 4 | type ConfirmOptions = { |
6 | title: string | 5 | title: string |
@@ -18,16 +17,12 @@ export class ConfirmService { | |||
18 | confirm (message: string, title = '', confirmButtonText?: string) { | 17 | confirm (message: string, title = '', confirmButtonText?: string) { |
19 | this.showConfirm.next({ title, message, confirmButtonText }) | 18 | this.showConfirm.next({ title, message, confirmButtonText }) |
20 | 19 | ||
21 | return this.confirmResponse.asObservable() | 20 | return firstValueFrom(this.confirmResponse.asObservable()) |
22 | .pipe(first()) | ||
23 | .toPromise() | ||
24 | } | 21 | } |
25 | 22 | ||
26 | confirmWithInput (message: string, inputLabel: string, expectedInputValue: string, title = '', confirmButtonText?: string) { | 23 | confirmWithInput (message: string, inputLabel: string, expectedInputValue: string, title = '', confirmButtonText?: string) { |
27 | this.showConfirm.next({ title, message, inputLabel, expectedInputValue, confirmButtonText }) | 24 | this.showConfirm.next({ title, message, inputLabel, expectedInputValue, confirmButtonText }) |
28 | 25 | ||
29 | return this.confirmResponse.asObservable() | 26 | return firstValueFrom(this.confirmResponse.asObservable()) |
30 | .pipe(first()) | ||
31 | .toPromise() | ||
32 | } | 27 | } |
33 | } | 28 | } |