showing consent in both ad controllers

This commit is contained in:
Miodec 2023-03-03 12:57:30 +01:00
parent ce82379dce
commit 1157f1e7c0
2 changed files with 13 additions and 4 deletions

View file

@ -256,6 +256,17 @@ export function updateTestPageAds(visible: boolean): void {
}
}
export function showConsentPopup(): void {
if (choice === "eg") {
//@ts-ignore
window.__tcfapi("displayConsentUi", 2, function () {
//
});
} else {
//todo
}
}
export function destroyResult(): void {
// $("#ad-result-wrapper").empty();
// $("#ad-result-small-wrapper").empty();

View file

@ -3,6 +3,7 @@ import { focusWords } from "../test/test-ui";
import * as Notifications from "../elements/notifications";
import * as Skeleton from "./skeleton";
import { isPopupVisible } from "../utils/misc";
import * as AdController from "../controllers/ad-controller";
const wrapperId = "cookiePopupWrapper";
@ -148,10 +149,7 @@ $(document).on("keypress", (e) => {
$("#cookiePopup .cookie.ads .textButton").on("click", () => {
try {
//@ts-ignore
window.__tcfapi("displayConsentUi", 2, function () {
//
});
AdController.showConsentPopup();
} catch (e) {
console.error("Failed to open ad consent UI");
Notifications.add(