From 561d71bc3f753730171b41325ef4a49863e33a0b Mon Sep 17 00:00:00 2001 From: Elblinator <69210919+Elblinator@users.noreply.github.com> Date: Tue, 30 Apr 2024 16:45:55 +0200 Subject: [PATCH] Fix editorial final version in a motion (#3621) --- .../motion-highlight-form.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-highlight-form/motion-highlight-form.component.ts b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-highlight-form/motion-highlight-form.component.ts index c492a96d50..bf7e1f558e 100644 --- a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-highlight-form/motion-highlight-form.component.ts +++ b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-highlight-form/motion-highlight-form.component.ts @@ -3,7 +3,7 @@ import { UntypedFormControl } from '@angular/forms'; import { ErrorStateMatcher } from '@angular/material/core'; import { MatLegacyMenuTrigger as MatMenuTrigger } from '@angular/material/legacy-menu'; import { TranslateService } from '@ngx-translate/core'; -import { combineLatest, Subscription } from 'rxjs'; +import { combineLatest, distinctUntilChanged, Subscription, takeUntil, timer } from 'rxjs'; import { ChangeRecoMode, LineNumberingMode } from 'src/app/domain/models/motions/motions.constants'; import { ViewMotion, ViewMotionChangeRecommendation } from 'src/app/site/pages/meetings/pages/motions'; import { ViewPortService } from 'src/app/site/services/view-port.service'; @@ -310,10 +310,10 @@ export class MotionHighlightFormComponent extends BaseMotionDetailChildComponent .get(`motions_default_line_numbering`) .subscribe(mode => this.setLineNumberingMode(mode)), combineLatest([ - this.changeRecoRepo.getViewModelListObservable(), - this.meetingSettingsService.get(`motions_recommendation_text_mode`) + this.changeRecoRepo.getViewModelListObservable().pipe(takeUntil(timer(1000))), + this.meetingSettingsService.get(`motions_recommendation_text_mode`).pipe(distinctUntilChanged()) ]).subscribe(([_, mode]) => { - if (mode) { + if (!this.isEditingFinalVersion && mode) { this.setChangeRecoMode(this.determineCrMode(mode as ChangeRecoMode)); } })