Skip to content

Commit

Permalink
Merge pull request #316 from vietredweb/update-blockjs
Browse files Browse the repository at this point in the history
Update block js
  • Loading branch information
NguyenBao10 authored Oct 5, 2024
2 parents 01f4f43 + 1b214ff commit dbbbcc8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Components/ConsentCustom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
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_degistered_scripts']) {
const blockJSList = window['aesirx_analytics_degistered_scripts'];
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 dbbbcc8

Please sign in to comment.