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