From e6fa867eb3205de00f9e35259be3e417bea8072c Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Thu, 12 Sep 2024 13:38:23 +0200 Subject: [PATCH] OZG-6499 first with filter instead of take --- .../lib/postfach-mail-form/postfach-mail.formservice.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/alfa-client/libs/postfach/src/lib/postfach-mail-form/postfach-mail.formservice.ts b/alfa-client/libs/postfach/src/lib/postfach-mail-form/postfach-mail.formservice.ts index 858d745b00..b20bd103a8 100644 --- a/alfa-client/libs/postfach/src/lib/postfach-mail-form/postfach-mail.formservice.ts +++ b/alfa-client/libs/postfach/src/lib/postfach-mail-form/postfach-mail.formservice.ts @@ -32,7 +32,7 @@ import { UntypedFormGroup, } from '@angular/forms'; import { ReplyOption } from 'libs/postfach-shared/src/lib/postfach.model'; -import { Observable, take } from 'rxjs'; +import { Observable, first } from 'rxjs'; @Injectable() export class PostfachMailFormservice extends AbstractFormService { @@ -63,11 +63,9 @@ export class PostfachMailFormservice extends AbstractFormService { public initMailBody(): void { this.postfachService .getSettings() - .pipe(take(1)) + .pipe(first((settings) => !!settings.signatur)) .subscribe((settings: PostfachSettings) => { - if (settings.signatur) { - this.patchMailBodyWithSignaturAndNewline(settings.signatur); - } + this.patchMailBodyWithSignaturAndNewline(settings.signatur); }); } -- GitLab