diff --git a/src/editors/data/redux/app/selectors.js b/src/editors/data/redux/app/selectors.js index 9976eee19f..d1c7ffd666 100644 --- a/src/editors/data/redux/app/selectors.js +++ b/src/editors/data/redux/app/selectors.js @@ -42,10 +42,9 @@ export const returnUrl = createSelector( export const isInitialized = createSelector( [ - module.simpleSelectors.unitUrl, module.simpleSelectors.blockValue, ], - (unitUrl, blockValue) => !!(unitUrl && blockValue), + (blockValue) => !!(blockValue), ); export const displayTitle = createSelector( diff --git a/src/editors/data/redux/thunkActions/app.js b/src/editors/data/redux/thunkActions/app.js index fa50c91a06..0bd1a070af 100644 --- a/src/editors/data/redux/thunkActions/app.js +++ b/src/editors/data/redux/thunkActions/app.js @@ -89,7 +89,9 @@ export const initialize = (data) => (dispatch) => { const editorType = data.blockType; dispatch(actions.app.initialize(data)); dispatch(module.fetchBlock()); - dispatch(module.fetchUnit()); + if (data.blockId.startsWith('block-v1:')) { + dispatch(module.fetchUnit()); + } switch (editorType) { case 'problem': dispatch(module.fetchImages({ pageNumber: 0 })); @@ -100,7 +102,12 @@ export const initialize = (data) => (dispatch) => { dispatch(module.fetchCourseDetails()); break; case 'html': - dispatch(module.fetchImages({ pageNumber: 0 })); + if (data.learningContextId.startsWith('lib:')) { + // eslint-disable-next-line no-console + console.log('Not fetching image assets - not implemented yet for content libraries.'); + } else { + dispatch(module.fetchImages({ pageNumber: 0 })); + } break; default: break; diff --git a/src/editors/data/services/cms/urls.js b/src/editors/data/services/cms/urls.js index de4e9f158a..d101ff9241 100644 --- a/src/editors/data/services/cms/urls.js +++ b/src/editors/data/services/cms/urls.js @@ -38,11 +38,7 @@ export const blockAncestor = ({ studioEndpointUrl, blockId }) => { if (blockId.includes('block-v1')) { return `${block({ studioEndpointUrl, blockId })}?fields=ancestorInfo`; } - // this url only need to get info to build the return url, which isn't used by V2 blocks - // (temporary) don't throw error, just return empty url. it will fail it's network connection but otherwise - // the app will run - // throw new Error('Block ancestor not available (and not needed) for V2 blocks'); - return ''; + throw new Error('Block ancestor not available (and not needed) for V2 blocks'); }; export const blockStudioView = ({ studioEndpointUrl, blockId }) => (