Skip to content

Commit

Permalink
fix reloading bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Medienkunzt committed Jan 15, 2024
1 parent b55e4e5 commit 16907c1
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit } from "@angular/core";
import { Component, OnInit, ChangeDetectorRef } from "@angular/core";
import { AuthService } from "src/app/service/auth.service";
import { TitlebarService } from "src/app/service/titlebar.service";
import { DomSanitizer, SafeResourceUrl } from "@angular/platform-browser";
Expand All @@ -15,7 +15,8 @@ export class FbsModellingComponent implements OnInit {
constructor(
private titlebar: TitlebarService,
private auth: AuthService,
private sanitizer: DomSanitizer
private sanitizer: DomSanitizer,
private cdr: ChangeDetectorRef
) {
this.token = this.auth.loadToken();
}
Expand All @@ -26,6 +27,7 @@ export class FbsModellingComponent implements OnInit {
getURL(): SafeResourceUrl {
const url = `https://fbs-modelling.mni.thm.de/#/login?jsessionid=${this.token}`;
this.safeUrl = this.sanitizer.bypassSecurityTrustResourceUrl(url);
this.cdr.detach(); // stops iframe from reloading
return this.safeUrl;
}
}

0 comments on commit 16907c1

Please sign in to comment.