Merge pull request #4283 from crazyserver/MOBILE-4680
MOBILE-4680 login: Fix demo site qr scan hidingmain
commit
11753a420f
|
@ -67,8 +67,6 @@ export class CoreLoginMethodsComponent implements OnInit {
|
|||
}
|
||||
|
||||
if (this.site) {
|
||||
this.showScanQR = CoreLoginHelper.displayQRInSiteScreen();
|
||||
|
||||
// The identity provider set in the site will be shown at the top.
|
||||
const oAuthId = this.site.getOAuthId();
|
||||
this.currentLoginProvider = CoreLoginHelper.findIdentityProvider(this.identityProviders, oAuthId);
|
||||
|
@ -78,15 +76,36 @@ export class CoreLoginMethodsComponent implements OnInit {
|
|||
provider.url !== this.currentLoginProvider?.url);
|
||||
}
|
||||
|
||||
// If still false or credentials screen.
|
||||
if (!this.site || !this.showScanQR) {
|
||||
this.showScanQR = await CoreLoginHelper.displayQRInCredentialsScreen(this.siteConfig.tool_mobile_qrcodetype);
|
||||
}
|
||||
await this.setShowScanQR();
|
||||
}
|
||||
|
||||
this.isReady.resolve();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if should show the scan QR code button.
|
||||
*/
|
||||
async setShowScanQR(): Promise<void> {
|
||||
if (this.site) {
|
||||
if (this.site.isDemoModeSite()) {
|
||||
this.showScanQR = false;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.showScanQR = CoreLoginHelper.displayQRInSiteScreen();
|
||||
|
||||
if (this.showScanQR) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// If still false or credentials screen.
|
||||
if (this.siteConfig) {
|
||||
this.showScanQR = await CoreLoginHelper.displayQRInCredentialsScreen(this.siteConfig.tool_mobile_qrcodetype);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show instructions and scan QR code.
|
||||
*/
|
||||
|
|
|
@ -62,7 +62,6 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy {
|
|||
pageLoaded = false;
|
||||
isBrowserSSO = false;
|
||||
showForgottenPassword = true;
|
||||
showScanQR = false;
|
||||
loginAttempts = 0;
|
||||
supportConfig?: CoreUserSupportConfig;
|
||||
exceededAttemptsHTML?: SafeHtml | string | null;
|
||||
|
@ -213,12 +212,6 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this.site.isDemoModeSite()) {
|
||||
this.showScanQR = false;
|
||||
} else {
|
||||
this.showScanQR = await CoreLoginHelper.displayQRInCredentialsScreen(this.siteConfig.tool_mobile_qrcodetype);
|
||||
}
|
||||
|
||||
this.canSignup = this.siteConfig.registerauth == 'email' && !this.site.isFeatureDisabled(EMAIL_SIGNUP_FEATURE_NAME);
|
||||
this.showForgottenPassword = !this.site.isFeatureDisabled(FORGOTTEN_PASSWORD_FEATURE_NAME);
|
||||
this.exceededAttemptsHTML = CoreLoginHelper.buildExceededAttemptsHTML(
|
||||
|
|
|
@ -69,7 +69,6 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
|
|||
isLoggedOut: boolean;
|
||||
siteId!: string;
|
||||
siteInfo?: CoreSiteBasicInfo;
|
||||
showScanQR = false;
|
||||
showLoading = true;
|
||||
reconnectAttempts = 0;
|
||||
supportConfig?: CoreUserSupportConfig;
|
||||
|
|
|
@ -1269,7 +1269,7 @@ export class CoreLoginHelperProvider {
|
|||
(CoreConstants.CONFIG.displayqroncredentialscreen !== undefined &&
|
||||
!!CoreConstants.CONFIG.displayqroncredentialscreen)) {
|
||||
|
||||
return qrCodeType == CoreSiteQRCodeType.QR_CODE_LOGIN;
|
||||
return qrCodeType === CoreSiteQRCodeType.QR_CODE_LOGIN;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue