Skip to content

Commit

Permalink
fix errors from console (#33)
Browse files Browse the repository at this point in the history
* fix errors from console

* only call martech stuff if it's active

* format content

* also check for metadata
  • Loading branch information
vhargrave authored Jul 2, 2024
1 parent 0703661 commit c3b5e48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion express/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ const CONFIG = {
links: 'on',
};

const urlParams = new URLSearchParams(window.location.search);

/*
* ------------------------------------------------------------
* Edit below at your own risk
Expand Down Expand Up @@ -120,7 +122,9 @@ decorateArea();

// listenMiloEvents();
buildAutoBlocks();
import('./instrument.js').then((mod) => { mod.default(); });
if (urlParams.get('martech') !== 'off' || getMetadata('martech') === 'off') {
import('./instrument.js').then((mod) => { mod.default(); });
}
if (getMetadata('sheet-powered') === 'Y') {
const { default: replaceContent } = await import('./utils/content-replace.js');
await replaceContent(document.querySelector('main'));
Expand Down
4 changes: 3 additions & 1 deletion express/scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,9 @@ export function buildAutoBlocks() {
button.appendChild(colEl);
button.classList.add('metadata-powered');
lastDiv.append(button);
import('./block-mediator.min.js').then((mod) => { mod.set('floatingCtasLoaded', true); });
import('./block-mediator.min.js').then((mod) => {
mod.default.set('floatingCtasLoaded', true);
});
}
}
}
Expand Down

0 comments on commit c3b5e48

Please sign in to comment.