MOBILE-2478 linux: Fix LTI in Linux

main
Dani Palou 2018-07-20 13:27:34 +02:00
parent 72f9759159
commit 4b45b3120b
1 changed files with 8 additions and 2 deletions

View File

@ -14,6 +14,7 @@
import { Injectable } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { CoreAppProvider } from '@providers/app';
import { CoreFileProvider } from '@providers/file';
import { CoreSitesProvider } from '@providers/sites';
import { CoreTextUtilsProvider } from '@providers/utils/text';
@ -40,7 +41,8 @@ export class AddonModLtiProvider {
private textUtils: CoreTextUtilsProvider,
private urlUtils: CoreUrlUtilsProvider,
private utils: CoreUtilsProvider,
private translate: TranslateService) {}
private translate: TranslateService,
private appProvider: CoreAppProvider) {}
/**
* Delete launcher.
@ -84,7 +86,11 @@ export class AddonModLtiProvider {
'</script> \n';
return this.fileProvider.writeFile(this.LAUNCHER_FILE_NAME, text).then((entry) => {
if (this.appProvider.isDesktop()) {
return entry.toInternalURL();
} else {
return entry.toURL();
}
});
}