From 323a0604a1f8084b4427af84e4352c8e20defb7c Mon Sep 17 00:00:00 2001 From: Sean Engelhardt Date: Wed, 21 Aug 2019 14:15:49 +0200 Subject: [PATCH] Fix firefox comment export Fixes an issue where motion comments where breaking the motion export dialog in firefox --- .../motion-export-dialog.component.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/client/src/app/site/motions/modules/shared-motion/motion-export-dialog/motion-export-dialog.component.ts b/client/src/app/site/motions/modules/shared-motion/motion-export-dialog/motion-export-dialog.component.ts index 305d6ab20..4c700fc91 100644 --- a/client/src/app/site/motions/modules/shared-motion/motion-export-dialog/motion-export-dialog.component.ts +++ b/client/src/app/site/motions/modules/shared-motion/motion-export-dialog/motion-export-dialog.component.ts @@ -3,6 +3,7 @@ import { FormBuilder, FormGroup } from '@angular/forms'; import { MatButtonToggle } from '@angular/material/button-toggle'; import { MatDialogRef } from '@angular/material/dialog'; +import { BehaviorSubject } from 'rxjs'; import { auditTime } from 'rxjs/operators'; import { StorageService } from 'app/core/core-services/storage.service'; @@ -42,6 +43,11 @@ export class MotionExportDialogComponent implements OnInit { */ public exportForm: FormGroup; + /** + * Store the subject to the ViewMotionCommentSection + */ + private commentsSubject: BehaviorSubject; + /** * The default export values in contrast to the restored values */ @@ -58,10 +64,10 @@ export class MotionExportDialogComponent implements OnInit { public metaInfoExportOrder: string[]; /** - * @returns a list of availavble commentSections + * @returns a list of available commentSections */ public get commentsToExport(): ViewMotionCommentSection[] { - return this.commentRepo.getViewModelList(); + return this.commentsSubject ? this.commentsSubject.value : []; } /** @@ -96,6 +102,7 @@ export class MotionExportDialogComponent implements OnInit { ) { this.defaults.lnMode = this.configService.instant('motions_default_line_numbering'); this.defaults.crMode = this.configService.instant('motions_recommendation_text_mode'); + this.commentsSubject = this.commentRepo.getViewModelListBehaviorSubject(); if (this.configService.instant('motions_show_sequential_numbers')) { this.defaults.metaInfo.push('id'); }