From 9df954bcb114952d7365a46db0f32d2081b9c55a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Mon, 21 Oct 2019 15:55:39 +0200 Subject: [PATCH] Fix dashboard.iframeUrl by keeping iframeUrl updated --- src/app/dashboard/dashboard.component.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index 89b5b5a..a12a8f3 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -100,7 +100,7 @@ export class DashboardComponent implements OnInit, OnDestroy { } reloadIframeHandler(message: WebSocketMessage) { - setTimeout(() => this.reloadIframeNoSubmit(), 200); + setTimeout(() => this.reloadIframe(), 200); } setLayout(layout: string) { @@ -115,14 +115,7 @@ export class DashboardComponent implements OnInit, OnDestroy { reloadIframe() { setTimeout(() => { - this.webiframe.nativeElement.contentWindow.location.reload(true); - }); - } - - reloadIframeNoSubmit() { - // Sometimes it is needed to reload the iframe without resending the previous form data - setTimeout(() => { - this.webiframe.nativeElement.contentWindow.location = this.webiframe.nativeElement.contentWindow.location.href; + this.webiframe.nativeElement.contentWindow.frames.location.href = this.iframeUrl.value; }); } @@ -155,7 +148,7 @@ export class DashboardComponent implements OnInit, OnDestroy { ) { return; } - this.webiframe.nativeElement.contentWindow.frames.location.href = this.urlbar.nativeElement.value; + this.iframeUrl.next(this.urlbar.nativeElement.value); } reloadIframeWhenResponseOk() {