Skip to content

Commit

Permalink
Update block js
Browse files Browse the repository at this point in the history
  • Loading branch information
vietredweb committed Oct 5, 2024
1 parent 01f4f43 commit 70d92ae
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Hooks/useConsentStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
}
};

Expand Down

0 comments on commit 70d92ae

Please sign in to comment.