From 70d92aec4177111b155065d2478d5bace9725f8b Mon Sep 17 00:00:00 2001 From: Viet Date: Sat, 5 Oct 2024 09:22:44 +0700 Subject: [PATCH 1/3] Update block js --- src/Hooks/useConsentStatus.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Hooks/useConsentStatus.ts b/src/Hooks/useConsentStatus.ts index 7f65826..e496d82 100644 --- a/src/Hooks/useConsentStatus.ts +++ b/src/Hooks/useConsentStatus.ts @@ -175,6 +175,16 @@ const useConsentStatus = (endpoint?: string, layout?: string, props?: WalletConn if (level && level !== '0') { window.funcAfterConsent && window.funcAfterConsent(); window.configBlockJS && unBlockScripts(); + if (window['aesirx_analytics_blockjs']) { + const blockJSList = window['aesirx_analytics_blockjs']; + Object.keys(blockJSList).forEach((key) => { + const scriptNode = document.createElement('script'); + scriptNode.src = + blockJSList[key].src + (blockJSList[key].ver ? `?ver=${blockJSList[key].ver}` : ''); + scriptNode.type = 'text/javascript'; + document.body.appendChild(scriptNode); + }); + } } }; From a5505c5ef235a4d2440860e94a5a673b9786baf9 Mon Sep 17 00:00:00 2001 From: Viet Date: Sat, 5 Oct 2024 09:40:49 +0700 Subject: [PATCH 2/3] Update --- src/Hooks/useConsentStatus.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Hooks/useConsentStatus.ts b/src/Hooks/useConsentStatus.ts index e496d82..30b0c98 100644 --- a/src/Hooks/useConsentStatus.ts +++ b/src/Hooks/useConsentStatus.ts @@ -175,8 +175,8 @@ const useConsentStatus = (endpoint?: string, layout?: string, props?: WalletConn if (level && level !== '0') { window.funcAfterConsent && window.funcAfterConsent(); window.configBlockJS && unBlockScripts(); - if (window['aesirx_analytics_blockjs']) { - const blockJSList = window['aesirx_analytics_blockjs']; + if (window['aesirx_analytics_degistered_scripts']) { + const blockJSList = window['aesirx_analytics_degistered_scripts']; Object.keys(blockJSList).forEach((key) => { const scriptNode = document.createElement('script'); scriptNode.src = From 1b214ff28a8833e734851658cde87a0d3e74d3ed Mon Sep 17 00:00:00 2001 From: Viet Date: Sat, 5 Oct 2024 10:43:29 +0700 Subject: [PATCH 3/3] update reload --- src/Components/ConsentCustom.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/ConsentCustom.tsx b/src/Components/ConsentCustom.tsx index 547685b..bf1eec7 100644 --- a/src/Components/ConsentCustom.tsx +++ b/src/Components/ConsentCustom.tsx @@ -933,7 +933,7 @@ const ConsentComponentCustomApp = (props: any) => { onClick={async () => { if (revokeConsentOption === 'consent') { await handleRevokeBtn(); - if (level > 1) { + if (level > 1 || window['aesirx1stparty']) { setTimeout(() => { window.location.reload(); }, 1000);