From 1ab1e247373becf416de95991989a6968ea000e2 Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Tue, 10 Sep 2024 11:30:07 +0200 Subject: [PATCH] OZG-6497 take instead of unsubscribe in formService --- .../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 0b5beafc1a..858d745b00 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, Subscription } from 'rxjs'; +import { Observable, take } from 'rxjs'; @Injectable() export class PostfachMailFormservice extends AbstractFormService { @@ -43,8 +43,6 @@ export class PostfachMailFormservice extends AbstractFormService { static readonly FIELD_REPLY_OPTION = 'replyOption'; static readonly FIELD_ATTACHMENTS = 'attachments'; - private loadPostfachSettingsSubscription: Subscription; - constructor( formBuilder: UntypedFormBuilder, private postfachService: PostfachService, @@ -63,13 +61,13 @@ export class PostfachMailFormservice extends AbstractFormService { } public initMailBody(): void { - this.loadPostfachSettingsSubscription = this.postfachService + this.postfachService .getSettings() + .pipe(take(1)) .subscribe((settings: PostfachSettings) => { if (settings.signatur) { this.patchMailBodyWithSignaturAndNewline(settings.signatur); } - this.loadPostfachSettingsSubscription.unsubscribe(); }); } -- GitLab