MOBILE-3617 login: Use login helper singleton on course helper
parent
78d41bddac
commit
2756395175
|
@ -34,7 +34,7 @@ import { CoreCourseProvider } from './course';
|
||||||
import { CoreCourseOfflineProvider } from './course-offline';
|
import { CoreCourseOfflineProvider } from './course-offline';
|
||||||
import { CoreCourseModuleDelegate } from './module-delegate';
|
import { CoreCourseModuleDelegate } from './module-delegate';
|
||||||
import { CoreCourseModulePrefetchDelegate } from './module-prefetch-delegate';
|
import { CoreCourseModulePrefetchDelegate } from './module-prefetch-delegate';
|
||||||
import { CoreLoginHelperProvider } from '@core/login/providers/helper';
|
import { CoreLoginHelper, CoreLoginHelperProvider } from '@core/login/providers/helper';
|
||||||
import { CoreConstants } from '@core/constants';
|
import { CoreConstants } from '@core/constants';
|
||||||
import { CoreSite } from '@classes/site';
|
import { CoreSite } from '@classes/site';
|
||||||
import { CoreLoggerProvider } from '@providers/logger';
|
import { CoreLoggerProvider } from '@providers/logger';
|
||||||
|
@ -122,7 +122,6 @@ export class CoreCourseHelperProvider {
|
||||||
private timeUtils: CoreTimeUtilsProvider,
|
private timeUtils: CoreTimeUtilsProvider,
|
||||||
private utils: CoreUtilsProvider,
|
private utils: CoreUtilsProvider,
|
||||||
private translate: TranslateService,
|
private translate: TranslateService,
|
||||||
private loginHelper: CoreLoginHelperProvider,
|
|
||||||
private courseOptionsDelegate: CoreCourseOptionsDelegate,
|
private courseOptionsDelegate: CoreCourseOptionsDelegate,
|
||||||
private siteHomeProvider: CoreSiteHomeProvider,
|
private siteHomeProvider: CoreSiteHomeProvider,
|
||||||
private eventsProvider: CoreEventsProvider,
|
private eventsProvider: CoreEventsProvider,
|
||||||
|
@ -1302,7 +1301,7 @@ export class CoreCourseHelperProvider {
|
||||||
if (courseId == site.getSiteHomeId()) {
|
if (courseId == site.getSiteHomeId()) {
|
||||||
// Check if site home is available.
|
// Check if site home is available.
|
||||||
return this.siteHomeProvider.isAvailable().then(() => {
|
return this.siteHomeProvider.isAvailable().then(() => {
|
||||||
this.loginHelper.redirect('CoreSiteHomeIndexPage', params, siteId);
|
CoreLoginHelper.instance.redirect('CoreSiteHomeIndexPage', params, siteId);
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
modal.dismiss();
|
modal.dismiss();
|
||||||
});
|
});
|
||||||
|
@ -1610,7 +1609,7 @@ export class CoreCourseHelperProvider {
|
||||||
params = params || {};
|
params = params || {};
|
||||||
Object.assign(params, { course: course });
|
Object.assign(params, { course: course });
|
||||||
|
|
||||||
return this.loginHelper.redirect(CoreLoginHelperProvider.OPEN_COURSE, params, siteId);
|
return CoreLoginHelper.instance.redirect(CoreLoginHelperProvider.OPEN_COURSE, params, siteId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ import { CoreConstants } from '@core/constants';
|
||||||
import { Md5 } from 'ts-md5/dist/md5';
|
import { Md5 } from 'ts-md5/dist/md5';
|
||||||
import { CoreSite } from '@classes/site';
|
import { CoreSite } from '@classes/site';
|
||||||
import { CoreUrl } from '@singletons/url';
|
import { CoreUrl } from '@singletons/url';
|
||||||
|
import { makeSingleton } from '@singletons/core.singletons';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data related to a SSO authentication.
|
* Data related to a SSO authentication.
|
||||||
|
@ -1417,3 +1418,5 @@ export class CoreLoginHelperProvider {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class CoreLoginHelper extends makeSingleton(CoreLoginHelperProvider) {}
|
||||||
|
|
Loading…
Reference in New Issue