Fix display ad event race condition (#19326)
* Mitigate race condition for async loaded billboard * Put observeDisplayAds in billboard.js
This commit is contained in:
parent
940c67a904
commit
51a2292fbd
1 changed files with 5 additions and 0 deletions
|
|
@ -23,6 +23,11 @@ async function generateDisplayAd(element) {
|
|||
element.innerHTML = '';
|
||||
element.appendChild(generatedElement);
|
||||
setupDisplayAdDropdown();
|
||||
// This is called here because the ad is loaded asynchronously.
|
||||
// The original code is still in the asset pipeline, so is not importable.
|
||||
// This could be refactored to be importable as we continue that migration.
|
||||
// eslint-disable-next-line no-undef
|
||||
observeDisplayAds();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue