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
Dani Palou 2023-05-10 12:31:15 +02:00
parent 96bdb4bd30
commit 47a8d5da35
2 changed files with 14 additions and 6 deletions

View File

@ -1,5 +1,10 @@
<core-loading [hideUntil]="!loading && safeUrl">
<core-navbar-buttons slot="end" prepend *ngIf="initialized && showFullscreenOnToolbar">
<!-- Display a loading until the iframe page is loaded. -->
<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()"
[attr.aria-label]="(fullscreen ? 'core.disablefullscreen' : 'core.fullscreen') | translate">
<ion-icon *ngIf="!fullscreen" name="fas-expand" slot="icon-only" aria-hidden="true"></ion-icon>
@ -7,13 +12,12 @@
</ion-button>
</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 *ngIf="safeUrl" [hidden]="loading" class="core-iframe" [ngStyle]="{'width': iframeWidth, 'height': iframeHeight}"
[src]="safeUrl" [attr.allowfullscreen]="allowFullscreen ? 'allowfullscreen' : null">
<iframe #iframe class="core-iframe" [ngStyle]="{'width': iframeWidth, 'height': iframeHeight}" [src]="safeUrl"
[attr.allowfullscreen]="allowFullscreen ? 'allowfullscreen' : null" [class.core-iframe-loading]="loading">
</iframe>
<ion-button *ngIf="!loading && displayHelp" expand="block" fill="clear" (click)="openIframeHelpModal()" aria-haspopup="dialog"
class="core-button-as-link core-iframe-help">
{{ 'core.iframehelp' | translate }}
</ion-button>
</core-loading>
</ng-container>

View File

@ -1,5 +1,9 @@
:host {
flex-grow: 1;
.core-iframe-loading {
display: none;
}
}
:host-context(.core-iframe-fullscreen) {