File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
static/examples/cstg-prebid-example Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 2020 const uid2 = pbjs . getUserIds ( ) . uid2 ;
2121
2222 // Check localStorage for opt-out status
23- const storedToken = localStorage . getItem ( '__uid2_advertising_token' ) ;
2423 let isOptedOut = false ;
24+ const storedToken = localStorage . getItem ( '__uid2_advertising_token' ) ;
2525 if ( storedToken ) {
2626 try {
2727 const tokenData = JSON . parse ( storedToken ) ;
5959 function handleClearStorage ( ) {
6060 console . log ( 'Clearing storage.' ) ;
6161 localStorage . removeItem ( '__uid2_advertising_token' ) ;
62- $ ( '#targeted_advertising_ready' ) . text ( 'no' ) ;
63- $ ( '#advertising_token' ) . text ( '' ) ;
64- $ ( '#login_form' ) . show ( ) ;
65- $ ( '#clear_storage_form' ) . hide ( ) ;
62+ location . reload ( ) ;
6663 }
6764
6865 function onDocumentReady ( ) {
6966 console . log ( 'Setting up interface handlers.' ) ;
67+ // Clear storage on page load for fresh start
68+ localStorage . removeItem ( '__uid2_advertising_token' ) ;
69+
7070 $ ( '#login' ) . click ( handleLogin ) ;
7171 $ ( '#clear_storage' ) . click ( handleClearStorage ) ;
7272
You can’t perform that action at this time.
0 commit comments