Skip to content

Commit

Permalink
Fix ads init
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically committed Sep 30, 2024
1 parent 624abf0 commit a466778
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions apps/frontend/src/public/promo-frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,26 @@
<div id="modrinth-rail-1" />
</div>
<script>
window.__TAURI_INTERNALS__.invoke("plugin:ads|get_ads_personalization", {})
.then((personalized) => {
window.tude = window.tude || { cmd: [] };
function initAds(personalized) {
window.tude = window.tude || { cmd: [] };

tude.cmd.push(function () {
tude.refreshAdsViaDivMappings([
{
divId: "modrinth-rail-1",
baseDivId: "pb-slot-square-2",
},
]);
tude.cmd.push(function () {
tude.refreshAdsViaDivMappings([
{
divId: "modrinth-rail-1",
baseDivId: "pb-slot-square-2",
},
]);

tude.setPrivacySettings({
personalizedAds: personalized ?? true,
})
});
tude.setPrivacySettings({
personalizedAds: personalized ?? true,
})
});
}

window.__TAURI_INTERNALS__.invoke("plugin:ads|get_ads_personalization", {})
.then(initAds)
.catch(() => initAds(true));

window.addEventListener(
"message",
Expand Down

0 comments on commit a466778

Please sign in to comment.