MOBILE-4239 core: Remove cannotconnect version
parent
5ecea64d70
commit
250c6c1db8
|
@ -15,7 +15,6 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { CoreError } from '@classes/errors/error';
|
||||
import { CoreSite } from '@classes/site';
|
||||
import { CoreCourseActivitySyncBaseProvider } from '@features/course/classes/activity-sync';
|
||||
import { CoreCourse, CoreCourseModuleBasicInfo } from '@features/course/services/course';
|
||||
import { CoreCourseLogHelper } from '@features/course/services/log-helper';
|
||||
|
@ -314,7 +313,7 @@ export class AddonModQuizSyncProvider extends CoreCourseActivitySyncBaseProvider
|
|||
|
||||
if (!CoreNetwork.isOnline()) {
|
||||
// Cannot sync in offline.
|
||||
throw new CoreError(Translate.instant('core.cannotconnect', { $a: CoreSite.MINIMUM_MOODLE_VERSION }));
|
||||
throw new CoreError(Translate.instant('core.cannotconnect'));
|
||||
}
|
||||
|
||||
const offlineAttempt = offlineAttempts.pop()!;
|
||||
|
|
|
@ -806,7 +806,7 @@ export class CoreSite {
|
|||
): Promise<T> {
|
||||
if (preSets.forceOffline) {
|
||||
// Don't call the WS, just fail.
|
||||
throw new CoreError(Translate.instant('core.cannotconnect', { $a: CoreSite.MINIMUM_MOODLE_VERSION }));
|
||||
throw new CoreError(Translate.instant('core.cannotconnect'));
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -1694,7 +1694,7 @@ export class CoreSite {
|
|||
.catch(async () => {
|
||||
if (cachePreSets.forceOffline) {
|
||||
// Don't call the WS, just fail.
|
||||
throw new CoreError(Translate.instant('core.cannotconnect', { $a: CoreSite.MINIMUM_MOODLE_VERSION }));
|
||||
throw new CoreError(Translate.instant('core.cannotconnect'));
|
||||
}
|
||||
|
||||
// Call the WS.
|
||||
|
|
|
@ -45,7 +45,6 @@ import { CoreErrorInfoComponent } from '@components/error-info/error-info';
|
|||
import { CoreUserSupportConfig } from '@features/user/classes/support/support-config';
|
||||
import { CoreUserGuestSupportConfig } from '@features/user/classes/support/guest-support-config';
|
||||
import { CoreLoginError } from '@classes/errors/loginerror';
|
||||
import { CoreSite } from '@classes/site';
|
||||
|
||||
/**
|
||||
* Site (url) chooser when adding a new site.
|
||||
|
@ -420,7 +419,7 @@ export class CoreLoginSitePage implements OnInit {
|
|||
text: Translate.instant('core.contactsupport'),
|
||||
handler: () => CoreUserSupport.contact({
|
||||
supportConfig: alertSupportConfig,
|
||||
subject: Translate.instant('core.cannotconnect', { $a: CoreSite.MINIMUM_MOODLE_VERSION }),
|
||||
subject: Translate.instant('core.cannotconnect'),
|
||||
message: `Error: ${errorCode}\n\n${errorDetails}`,
|
||||
}),
|
||||
}
|
||||
|
@ -435,11 +434,10 @@ export class CoreLoginSitePage implements OnInit {
|
|||
),
|
||||
].filter(button => !!button);
|
||||
|
||||
// @todo Remove CoreSite.MINIMUM_MOODLE_VERSION, not used on translations since 3.9.0.
|
||||
const alertElement = await CoreDomUtils.showAlertWithOptions({
|
||||
header: errorTitle ?? (
|
||||
siteExists
|
||||
? Translate.instant('core.cannotconnect', { $a: CoreSite.MINIMUM_MOODLE_VERSION })
|
||||
? Translate.instant('core.cannotconnect')
|
||||
: Translate.instant('core.sitenotfound')
|
||||
),
|
||||
message: errorMessage ?? Translate.instant('core.sitenotfoundhelp'),
|
||||
|
|
|
@ -55,7 +55,6 @@ import { lazyMap, LazyMap } from '../utils/lazy-map';
|
|||
import { asyncInstance, AsyncInstance } from '../utils/async-instance';
|
||||
import { CorePath } from '@singletons/path';
|
||||
import { CorePromisedValue } from '@classes/promised-value';
|
||||
import { CoreSite } from '@classes/site';
|
||||
|
||||
/*
|
||||
* Factory for handling downloading files and retrieve downloaded files.
|
||||
|
@ -510,7 +509,7 @@ export class CoreFilepoolProvider {
|
|||
} else {
|
||||
if (!CoreNetwork.isOnline()) {
|
||||
// Cannot check size in offline, stop.
|
||||
throw new CoreError(Translate.instant('core.cannotconnect', { $a: CoreSite.MINIMUM_MOODLE_VERSION }));
|
||||
throw new CoreError(Translate.instant('core.cannotconnect'));
|
||||
}
|
||||
|
||||
size = await CoreWS.getRemoteFileSize(fileUrl);
|
||||
|
|
|
@ -363,7 +363,7 @@ export class CoreSitesProvider {
|
|||
if (error instanceof CoreAjaxError || !('errorcode' in error)) {
|
||||
// The WS didn't return data, probably cannot connect.
|
||||
return new CoreLoginError({
|
||||
title: Translate.instant('core.cannotconnect', { $a: CoreSite.MINIMUM_MOODLE_VERSION }),
|
||||
title: Translate.instant('core.cannotconnect'),
|
||||
message: Translate.instant('core.siteunavailablehelp', { site: siteUrl }),
|
||||
errorcode: 'publicconfigfailed',
|
||||
errorDetails: error.message || '',
|
||||
|
@ -374,7 +374,7 @@ export class CoreSitesProvider {
|
|||
// Service supported but an error happened. Return error.
|
||||
const options: CoreLoginErrorOptions = {
|
||||
critical: true,
|
||||
title: Translate.instant('core.cannotconnect', { $a: CoreSite.MINIMUM_MOODLE_VERSION }),
|
||||
title: Translate.instant('core.cannotconnect'),
|
||||
message: Translate.instant('core.siteunavailablehelp', { site: siteUrl }),
|
||||
errorcode: error.errorcode,
|
||||
supportConfig: error.supportConfig,
|
||||
|
|
|
@ -57,7 +57,6 @@ import { CoreNetwork } from '@services/network';
|
|||
import { CoreSiteError } from '@classes/errors/siteerror';
|
||||
import { CoreUserSupport } from '@features/user/services/support';
|
||||
import { CoreErrorInfoComponent } from '@components/error-info/error-info';
|
||||
import { CoreSite } from '@classes/site';
|
||||
|
||||
/*
|
||||
* "Utils" service with helper functions for UI, DOM elements and HTML code.
|
||||
|
@ -1373,7 +1372,7 @@ export class CoreDomUtilsProvider {
|
|||
} else if (this.isSiteUnavailableError(message)) {
|
||||
alertOptions.header = CoreSites.isLoggedIn()
|
||||
? Translate.instant('core.connectionlost')
|
||||
: Translate.instant('core.cannotconnect', { $a: CoreSite.MINIMUM_MOODLE_VERSION });
|
||||
: Translate.instant('core.cannotconnect');
|
||||
} else {
|
||||
alertOptions.header = Translate.instant('core.error');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue