From 637565a620a8968bcc3fa3af94371b744dc0b648 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 12 Dec 2019 20:24:46 +0100 Subject: [PATCH] Formatting fixes. --- .../pages/content/content-page.component.html | 2 +- .../pages/content/content-page.component.ts | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/frontend/app/features/content/pages/content/content-page.component.html b/frontend/app/features/content/pages/content/content-page.component.html index 548997d3c..d37a274da 100644 --- a/frontend/app/features/content/pages/content/content-page.component.html +++ b/frontend/app/features/content/pages/content/content-page.component.html @@ -1,7 +1,7 @@
- + diff --git a/frontend/app/features/content/pages/content/content-page.component.ts b/frontend/app/features/content/pages/content/content-page.component.ts index e1bfec5fc..76ac317f7 100644 --- a/frontend/app/features/content/pages/content/content-page.component.ts +++ b/frontend/app/features/content/pages/content/content-page.component.ts @@ -48,6 +48,9 @@ export class ContentPageComponent extends ResourceOwner implements CanComponentD private isLoadingContent: boolean; private autoSaveKey: AutoSaveKey; + @ViewChild('dueTimeSelector', { static: false }) + public dueTimeSelector: DueTimeSelectorComponent; + public schema: SchemaDetailsDto; public formContext: any; @@ -62,15 +65,8 @@ export class ContentPageComponent extends ResourceOwner implements CanComponentD public language: AppLanguageDto; public languages: ReadonlyArray; - public get hasContent() { - return !!this.content; - } - public trackByFieldFn: (index: number, field: FieldDto) => any; - @ViewChild('dueTimeSelector', { static: false }) - public dueTimeSelector: DueTimeSelectorComponent; - constructor(apiUrl: ApiUrlConfig, authService: AuthService, public readonly contentsState: ContentsState, private readonly autoSaveService: AutoSaveService, @@ -237,14 +233,18 @@ export class ContentPageComponent extends ResourceOwner implements CanComponentD } public discardChanges() { - if (this.content) { - this.contentsState.discardDraft(this.content); + const content = this.content; + + if (content) { + this.contentsState.discardDraft(content); } } public delete() { - if (this.content) { - this.contentsState.deleteMany([this.content]).pipe(onErrorResumeNext()) + const content = this.content; + + if (content) { + this.contentsState.deleteMany([content]).pipe(onErrorResumeNext()) .subscribe(() => { this.back(); });