From a7ab5f0ca3040b5972f5e7c1daed1854bb32d9f0 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 18 Nov 2019 20:45:14 +0100 Subject: [PATCH] Typing fix. --- .../features/content/shared/preview-button.component.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/app/features/content/shared/preview-button.component.ts b/frontend/app/features/content/shared/preview-button.component.ts index b2f94c76b..9b32f562b 100644 --- a/frontend/app/features/content/shared/preview-button.component.ts +++ b/frontend/app/features/content/shared/preview-button.component.ts @@ -59,10 +59,12 @@ export class PreviewButtonComponent extends StatefulComponent implements this.selectUrl(selectedName); } - public follow(name: string) { - this.selectUrl(name); + public follow(name?: string) { + if (name) { + this.selectUrl(name); - this.navigateTo(name); + this.navigateTo(name); + } this.dropdown.hide(); } @@ -78,6 +80,7 @@ export class PreviewButtonComponent extends StatefulComponent implements if (selectedName === s.previewNameSelected) { return s; } + const state = { ...s }; const keys = Object.keys(this.schema.previewUrls);