From 19cec7eeac201ff341b1adf755c3d392eac7e6c5 Mon Sep 17 00:00:00 2001 From: Mikael Karlsson Date: Fri, 16 Mar 2018 09:24:32 +0100 Subject: [PATCH] fix(component): dont load the app on first change. This caused two rapid loads, one in ngOnChanges and one in ngOnInit. The second of which tried to load data into the existing frame which hadn't been inserted into the dom yet. --- src/powerbi-component.component.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/powerbi-component.component.ts b/src/powerbi-component.component.ts index 2885f6e..26b2224 100644 --- a/src/powerbi-component.component.ts +++ b/src/powerbi-component.component.ts @@ -43,6 +43,10 @@ export class PowerBIComponentComponent implements OnInit, OnChanges { ngOnChanges(changes: SimpleChanges): void { const { accessToken, tokenType, embedUrl, type, id } = changes; + if (accessToken.isFirstChange() && embedUrl.isFirstChange()) { + return; + } + if (accessToken.previousValue === accessToken.currentValue || embedUrl.previousValue === embedUrl.currentValue) { return;