diff --git a/src/Components/ConsentCustom.tsx b/src/Components/ConsentCustom.tsx index bde08f4..39e3d1b 100644 --- a/src/Components/ConsentCustom.tsx +++ b/src/Components/ConsentCustom.tsx @@ -677,11 +677,6 @@ const ConsentComponentCustomApp = (props: any) => { event_name: 'Revoke consent', event_type: 'revoke-consent', }); - if (levelRevoke === '1' && window['aesirx1stparty']) { - setTimeout(() => { - window.location.reload(); - }, 1000); - } } catch (error) { console.log(error); setLoading('done'); @@ -938,6 +933,14 @@ const ConsentComponentCustomApp = (props: any) => { onClick={async () => { if (revokeConsentOption === 'consent') { await handleRevokeBtn(); + const levelRevoke = + sessionStorage.getItem('aesirx-analytics-revoke') && + parseInt(sessionStorage.getItem('aesirx-analytics-revoke')); + if (levelRevoke > 1 || window['aesirx1stparty']) { + setTimeout(() => { + window.location.reload(); + }, 1000); + } } else { sessionStorage.removeItem(revokeConsentOption); setShowExpandRevoke(false);