MOBILE-4270 iframe: Fix auto-login not working sometimes
This was because core-loading removed the iframe from DOM, and then the WebView canceled the request. But the request could have consumed the single use key already.main
parent
96bdb4bd30
commit
47a8d5da35
|
@ -1,5 +1,10 @@
|
||||||
<core-loading [hideUntil]="!loading && safeUrl">
|
<!-- Display a loading until the iframe page is loaded. -->
|
||||||
<core-navbar-buttons slot="end" prepend *ngIf="initialized && showFullscreenOnToolbar">
|
<core-loading [hideUntil]="!loading && safeUrl"></core-loading>
|
||||||
|
|
||||||
|
<!--The iframe needs to be outside of core-loading, otherwise the request is canceled while loading. -->
|
||||||
|
<!-- Don't add the iframe until safeUrl is set, adding an iframe with null as src causes the iframe to load the whole app. -->
|
||||||
|
<ng-container *ngIf="safeUrl">
|
||||||
|
<core-navbar-buttons slot="end" prepend *ngIf="initialized && showFullscreenOnToolbar && !loading">
|
||||||
<ion-button fill="clear" (click)="toggleFullscreen()"
|
<ion-button fill="clear" (click)="toggleFullscreen()"
|
||||||
[attr.aria-label]="(fullscreen ? 'core.disablefullscreen' : 'core.fullscreen') | translate">
|
[attr.aria-label]="(fullscreen ? 'core.disablefullscreen' : 'core.fullscreen') | translate">
|
||||||
<ion-icon *ngIf="!fullscreen" name="fas-expand" slot="icon-only" aria-hidden="true"></ion-icon>
|
<ion-icon *ngIf="!fullscreen" name="fas-expand" slot="icon-only" aria-hidden="true"></ion-icon>
|
||||||
|
@ -7,13 +12,12 @@
|
||||||
</ion-button>
|
</ion-button>
|
||||||
</core-navbar-buttons>
|
</core-navbar-buttons>
|
||||||
|
|
||||||
<!-- Don't add the iframe until safeUrl is set, adding an iframe with null as src causes the iframe to load the whole app. -->
|
<iframe #iframe class="core-iframe" [ngStyle]="{'width': iframeWidth, 'height': iframeHeight}" [src]="safeUrl"
|
||||||
<iframe #iframe *ngIf="safeUrl" [hidden]="loading" class="core-iframe" [ngStyle]="{'width': iframeWidth, 'height': iframeHeight}"
|
[attr.allowfullscreen]="allowFullscreen ? 'allowfullscreen' : null" [class.core-iframe-loading]="loading">
|
||||||
[src]="safeUrl" [attr.allowfullscreen]="allowFullscreen ? 'allowfullscreen' : null">
|
|
||||||
</iframe>
|
</iframe>
|
||||||
|
|
||||||
<ion-button *ngIf="!loading && displayHelp" expand="block" fill="clear" (click)="openIframeHelpModal()" aria-haspopup="dialog"
|
<ion-button *ngIf="!loading && displayHelp" expand="block" fill="clear" (click)="openIframeHelpModal()" aria-haspopup="dialog"
|
||||||
class="core-button-as-link core-iframe-help">
|
class="core-button-as-link core-iframe-help">
|
||||||
{{ 'core.iframehelp' | translate }}
|
{{ 'core.iframehelp' | translate }}
|
||||||
</ion-button>
|
</ion-button>
|
||||||
</core-loading>
|
</ng-container>
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
:host {
|
:host {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
|
||||||
|
.core-iframe-loading {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
:host-context(.core-iframe-fullscreen) {
|
:host-context(.core-iframe-fullscreen) {
|
||||||
|
|
Loading…
Reference in New Issue