diff --git a/src/core/login/pages/site/site.ts b/src/core/login/pages/site/site.ts index e9f70f3d1..c78c4fd74 100644 --- a/src/core/login/pages/site/site.ts +++ b/src/core/login/pages/site/site.ts @@ -526,7 +526,7 @@ export class CoreLoginSitePage { // Check if site uses SSO. const response = await this.sitesProvider.checkSite(siteUrl); - await this.sitesProvider.checkRequiredMinimumVersion(response.config); + await this.sitesProvider.checkApplication(response.config); if (!this.loginHelper.isSSOLoginNeeded(response.code)) { // No SSO, go to credentials page. diff --git a/src/core/login/providers/cron-handler.ts b/src/core/login/providers/cron-handler.ts index f821b7172..c6db2d07d 100644 --- a/src/core/login/providers/cron-handler.ts +++ b/src/core/login/providers/cron-handler.ts @@ -44,7 +44,7 @@ export class CoreLoginCronHandler implements CoreCronHandler { return site.getPublicConfig().catch(() => { return {}; }).then((config) => { - this.sitesProvider.checkRequiredMinimumVersion(config).catch(() => { + this.sitesProvider.checkApplication(config).catch(() => { // Ignore errors. }); diff --git a/src/providers/sites.ts b/src/providers/sites.ts index 1991c89d1..335fe8a33 100644 --- a/src/providers/sites.ts +++ b/src/providers/sites.ts @@ -1039,20 +1039,19 @@ export class CoreSitesProvider { /** * Check the app for a site and show a download dialogs if necessary. * - * @param response Data obtained during site check. + * @param config Config object of the site. */ - async checkApplication(response: CoreSiteCheckResponse): Promise { - await this.checkRequiredMinimumVersion(response.config); + async checkApplication(config: any): Promise { + await this.checkRequiredMinimumVersion(config); } /** * Check the required minimum version of the app for a site and shows a download dialog. * - * @param config Config object of the site. - * @param siteId ID of the site to check. Current site id will be used otherwise. + * @param config Config object of the site. * @return Resolved with if meets the requirements, rejected otherwise. */ - checkRequiredMinimumVersion(config: any, siteId?: string): Promise { + protected checkRequiredMinimumVersion(config: any): Promise { if (config && config.tool_mobile_minimumversion) { const requiredVersion = this.convertVersionName(config.tool_mobile_minimumversion), appVersion = this.convertVersionName(CoreConfigConstants.versionname); @@ -1067,8 +1066,7 @@ export class CoreSitesProvider { }; const downloadUrl = this.appProvider.getAppStoreUrl(storesConfig); - - siteId = siteId || this.getCurrentSiteId(); + const siteId = this.getCurrentSiteId(); // Do not block interface. this.domUtils.showConfirm( @@ -1159,7 +1157,7 @@ export class CoreSitesProvider { return site.getPublicConfig().catch(() => { return {}; }).then((config) => { - return this.checkRequiredMinimumVersion(config).then(() => { + return this.checkApplication(config).then(() => { this.login(siteId); // Update site info. We don't block the UI. diff --git a/src/providers/urlschemes.ts b/src/providers/urlschemes.ts index 5b3828ec9..a13596b2e 100644 --- a/src/providers/urlschemes.ts +++ b/src/providers/urlschemes.ts @@ -102,7 +102,7 @@ export class CoreCustomURLSchemesProvider { data.siteUrl = result.siteUrl; - await this.sitesProvider.checkRequiredMinimumVersion(result.config); + await this.sitesProvider.checkApplication(result.config); } return this.sitesProvider.newSite(data.siteUrl, data.token, data.privateToken, !!data.isSSOToken,