Skip to content

Commit

Permalink
TDW-2277 moved placeholder call to outside the function
Browse files Browse the repository at this point in the history
  • Loading branch information
bosco-ensemble committed Apr 9, 2024
1 parent 7184608 commit d2a760b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,9 @@ async function waitForLCP() {
});
}

// eslint-disable-next-line no-use-before-define
const placeholders = await fetchPlaceholders();

/**
* Decorates the page.
*/
Expand All @@ -710,7 +713,7 @@ async function loadPage(doc) {
// eslint-disable-next-line no-use-before-define
await loadLazy(doc);
// eslint-disable-next-line no-use-before-define
await loadAds();
await loadAds(placeholders);
// eslint-disable-next-line no-use-before-define
loadDelayed(doc);
}
Expand Down Expand Up @@ -1195,8 +1198,7 @@ async function OptanonWrapper() {
await sendAnalyticsPageEvent();
}

async function loadAds() {
const placeholders = await fetchPlaceholders();
async function loadAds(placeholders) {

Check failure on line 1201 in scripts/scripts.js

View workflow job for this annotation

GitHub Actions / build

'placeholders' is already declared in the upper scope on line 705 column 7
const isProd = window.location.hostname.endsWith(placeholders.hostname);

if (!isProd === 'this') {
Expand Down

0 comments on commit d2a760b

Please sign in to comment.