Fix ad init not working on no tauri invoke

This commit is contained in:
Jai A 2024-10-09 14:04:33 -07:00
parent 115acce80c
commit d302795512
No known key found for this signature in database
GPG Key ID: 9A9F9B7250E9883C

View File

@ -73,17 +73,26 @@
});
const hash = getCookie("modrinth-app-token");
console.log(hash)
console.log(hash);
tude.setIdProfile({
e: hash,
});
});
}
window.__TAURI_INTERNALS__
.invoke("plugin:ads|get_ads_personalization", {})
.then(initAds)
.catch(() => initAds(true));
try {
if (window.__TAURI_INTERNALS__) {
window.__TAURI_INTERNALS__
.invoke("plugin:ads|get_ads_personalization", {})
.then(initAds)
.catch(() => initAds(true));
} else {
initAds(true);
}
} catch (err) {
initAds(true);
console.error(err);
}
window.addEventListener(
"message",