diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-17 11:27:47 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-17 14:01:45 +0200 |
commit | 1378c0d343028f3d40d7d795422684ab9e6a1599 (patch) | |
tree | 08062b84a38a7e2dfe0aa674e7ca8e1b7321044e /client/src/app/core/confirm/confirm.service.ts | |
parent | c186a67f90203af6bfa434f026efdc99193bcd65 (diff) | |
download | PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.gz PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.zst PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.zip |
Fix client lint
Diffstat (limited to 'client/src/app/core/confirm/confirm.service.ts')
-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 | } |