Skip to content

Commit

Permalink
Merge pull request #41 from Netcentric/result-page-loading
Browse files Browse the repository at this point in the history
Result page loading
  • Loading branch information
nc-andreashaller authored Mar 19, 2024
2 parents f92f557 + 412c896 commit df18055
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
5 changes: 2 additions & 3 deletions scripts/aem.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,9 @@ function buildBlock(blockName, content) {
* @param {Element} block The block element
*/
async function loadBlock(block) {
const status = block.dataset.blockStatus;
if (status !== 'loading' && status !== 'loaded') {
const { blockName, status } = block.dataset;
if (blockName && status !== 'loading' && status !== 'loaded') {
block.dataset.blockStatus = 'loading';
const { blockName } = block.dataset;
try {
const cssLoaded = loadCSS(`${window.hlx.codeBasePath}/blocks/${blockName}/${blockName}.css`);
const decorationComplete = new Promise((resolve) => {
Expand Down
9 changes: 1 addition & 8 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,7 @@ async function prepareSpecification() {
const isEngineFocus = !isShipFocus && isTemplate('engine-focus');
const isConfigurationResult = !isShipFocus && !isEngineFocus && isTemplate('configuration-result');
try {
const configurationsPromise = isConfigurationResult && fetch('https://main--edge-delivery-solari--netcentric.hlx.page/configurations.json', {
mode: 'no-cors',
cache: 'no-cache',
headers: {
'Content-Type': 'application/json',
'Cache-Control': 'no-cache',
},
});
const configurationsPromise = isConfigurationResult && fetch('/configurations.json', { cache: 'no-cache' });

if (!isShipFocus && !isEngineFocus && !isConfigurationResult) {
return;
Expand Down

0 comments on commit df18055

Please sign in to comment.