]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/confirm/confirm.service.ts
Translated using Weblate (German)
[github/Chocobozzz/PeerTube.git] / client / src / app / core / confirm / confirm.service.ts
index 6e042c16bf5f99485b0b58efdcc749e65a52b5f9..338b8762c97d83a3dcd5d96b9c6cc0f5f16dce24 100644 (file)
@@ -1,6 +1,5 @@
-import { first } from 'rxjs/operators'
+import { firstValueFrom, Subject } from 'rxjs'
 import { Injectable } from '@angular/core'
-import { Subject } from 'rxjs'
 
 type ConfirmOptions = {
   title: string
@@ -18,16 +17,12 @@ export class ConfirmService {
   confirm (message: string, title = '', confirmButtonText?: string) {
     this.showConfirm.next({ title, message, confirmButtonText })
 
-    return this.confirmResponse.asObservable()
-               .pipe(first())
-               .toPromise()
+    return firstValueFrom(this.confirmResponse.asObservable())
   }
 
   confirmWithInput (message: string, inputLabel: string, expectedInputValue: string, title = '', confirmButtonText?: string) {
     this.showConfirm.next({ title, message, inputLabel, expectedInputValue, confirmButtonText })
 
-    return this.confirmResponse.asObservable()
-               .pipe(first())
-               .toPromise()
+    return firstValueFrom(this.confirmResponse.asObservable())
   }
 }