Fix ads init

This commit is contained in:
Jai A 2024-09-29 17:57:16 -07:00
parent 624abf0df4
commit a46677832b
No known key found for this signature in database
GPG Key ID: 9A9F9B7250E9883C

View File

@ -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",