MOBILE-3686 core: Remove some legacy instace usage on singletons
parent
233e401a23
commit
ef610babd7
|
@ -170,7 +170,7 @@ export class AddonBlogEntriesPage implements OnInit {
|
||||||
entry.contextInstanceId = entry.userid;
|
entry.contextInstanceId = entry.userid;
|
||||||
}
|
}
|
||||||
|
|
||||||
entry.summary = CoreTextUtils.instance.replacePluginfileUrls(entry.summary, entry.summaryfiles || []);
|
entry.summary = CoreTextUtils.replacePluginfileUrls(entry.summary, entry.summaryfiles || []);
|
||||||
|
|
||||||
return CoreUser.getProfile(entry.userid, entry.courseid, true).then((user) => {
|
return CoreUser.getProfile(entry.userid, entry.courseid, true).then((user) => {
|
||||||
entry.user = user;
|
entry.user = user;
|
||||||
|
|
|
@ -118,7 +118,7 @@ export class AddonModScormPlayerPage implements OnInit, OnDestroy {
|
||||||
try {
|
try {
|
||||||
await this.setStartTime(this.currentSco.id);
|
await this.setStartTime(this.currentSco.id);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.instance.showErrorModalDefault(error, 'addon.mod_scorm.errorgetscorm', true);
|
CoreDomUtils.showErrorModalDefault(error, 'addon.mod_scorm.errorgetscorm', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ export class AddonModScormPlayerPage implements OnInit, OnDestroy {
|
||||||
try {
|
try {
|
||||||
AddonModScormHelper.convertAttemptToOffline(this.scorm, this.attempt);
|
AddonModScormHelper.convertAttemptToOffline(this.scorm, this.attempt);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.instance.showErrorModalDefault(error, 'core.error', true);
|
CoreDomUtils.showErrorModalDefault(error, 'core.error', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.refreshToc();
|
this.refreshToc();
|
||||||
|
@ -303,7 +303,7 @@ export class AddonModScormPlayerPage implements OnInit, OnDestroy {
|
||||||
this.userData = data;
|
this.userData = data;
|
||||||
this.accessInfo = accessInfo;
|
this.accessInfo = accessInfo;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.instance.showErrorModalDefault(error, 'addon.mod_scorm.errorgetscorm', true);
|
CoreDomUtils.showErrorModalDefault(error, 'addon.mod_scorm.errorgetscorm', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -469,7 +469,7 @@ export class AddonModScormPlayerPage implements OnInit, OnDestroy {
|
||||||
|
|
||||||
await AddonModScorm.saveTracks(sco.id, this.attempt, tracks, this.scorm, true);
|
await AddonModScorm.saveTracks(sco.id, this.attempt, tracks, this.scorm, true);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.instance.showErrorModalDefault(error, 'core.error', true);
|
CoreDomUtils.showErrorModalDefault(error, 'core.error', true);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
// Refresh TOC, some prerequisites might have changed.
|
// Refresh TOC, some prerequisites might have changed.
|
||||||
|
@ -510,7 +510,7 @@ export class AddonModScormPlayerPage implements OnInit, OnDestroy {
|
||||||
|
|
||||||
await this.fetchToc();
|
await this.fetchToc();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.instance.showErrorModalDefault(error, 'addon.mod_scorm.errorgetscorm', true);
|
CoreDomUtils.showErrorModalDefault(error, 'addon.mod_scorm.errorgetscorm', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ export class AppComponent implements OnInit, AfterViewInit {
|
||||||
});
|
});
|
||||||
CoreUtils.closeInAppBrowser();
|
CoreUtils.closeInAppBrowser();
|
||||||
|
|
||||||
} else if (CoreApp.instance.isAndroid()) {
|
} else if (CoreApp.isAndroid()) {
|
||||||
// Check if the URL has a custom URL scheme. In Android they need to be opened manually.
|
// Check if the URL has a custom URL scheme. In Android they need to be opened manually.
|
||||||
const urlScheme = CoreUrlUtils.getUrlProtocol(url);
|
const urlScheme = CoreUrlUtils.getUrlProtocol(url);
|
||||||
if (urlScheme && urlScheme !== 'file' && urlScheme !== 'cdvfile') {
|
if (urlScheme && urlScheme !== 'file' && urlScheme !== 'cdvfile') {
|
||||||
|
|
|
@ -124,7 +124,7 @@ export class CoreSitePluginsCallWSBaseDirective implements OnInit, OnDestroy {
|
||||||
invalidate(): Promise<void> {
|
invalidate(): Promise<void> {
|
||||||
const params = this.getParamsForWS();
|
const params = this.getParamsForWS();
|
||||||
|
|
||||||
return CoreSitePlugins.instance.invalidateCallWS(this.name, params, this.preSets);
|
return CoreSitePlugins.invalidateCallWS(this.name, params, this.preSets);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue