mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-07-01 14:36:13 +00:00
accompanying course: fetch scopes only for app (not for banner)
This commit is contained in:
parent
fefe208260
commit
2eb5c45a4d
@ -13,10 +13,14 @@ import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods';
|
|||||||
const debug = process.env.NODE_ENV !== 'production';
|
const debug = process.env.NODE_ENV !== 'production';
|
||||||
const id = window.accompanyingCourseId;
|
const id = window.accompanyingCourseId;
|
||||||
|
|
||||||
let scopesPromise = fetchScopes();
|
let getScopesPromise = (root) => {
|
||||||
|
if (root === 'app') {
|
||||||
|
return fetchScopes();
|
||||||
|
}
|
||||||
|
}
|
||||||
let accompanyingCoursePromise = getAccompanyingCourse(id);
|
let accompanyingCoursePromise = getAccompanyingCourse(id);
|
||||||
|
|
||||||
let initPromise = (root) => Promise.all([scopesPromise, accompanyingCoursePromise])
|
let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCoursePromise])
|
||||||
.then(([scopes, accompanyingCourse]) => new Promise((resolve, reject) => {
|
.then(([scopes, accompanyingCourse]) => new Promise((resolve, reject) => {
|
||||||
|
|
||||||
const store = createStore({
|
const store = createStore({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user