File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,16 +73,16 @@ const options: ConsentManagerOptions = backendURL
7373
7474function DialogDismissHandler ( ) {
7575 const { activeUI, setActiveUI } = useConsentManager ( )
76- const isPrivacyDialogOpen = activeUI === "dialog"
76+ const isDialogOpen = activeUI === "dialog"
7777
78- // 1.x used setIsPrivacyDialogOpen(false) + setShowPopup(true) ; in 2.x a single
79- // setActiveUI("banner") closes the dialog and re-shows the banner.
78+ // 1.x used two separate setters ; in 2.x a single setActiveUI("banner") closes
79+ // the dialog and re-shows the banner.
8080 const dismiss = useCallback ( ( ) => {
8181 setActiveUI ( "banner" )
8282 } , [ setActiveUI ] )
8383
8484 useEffect ( ( ) => {
85- if ( ! isPrivacyDialogOpen ) return
85+ if ( ! isDialogOpen ) return
8686
8787 const handleKeyDown = ( e : KeyboardEvent ) => {
8888 if ( e . key === "Escape" ) {
@@ -104,7 +104,7 @@ function DialogDismissHandler() {
104104 document . removeEventListener ( "keydown" , handleKeyDown )
105105 document . removeEventListener ( "click" , handleClick )
106106 }
107- } , [ isPrivacyDialogOpen , dismiss ] )
107+ } , [ isDialogOpen , dismiss ] )
108108
109109 return null
110110}
You can’t perform that action at this time.
0 commit comments