Skip to content

Commit 084f9df

Browse files
fiveonefour-github-botclaudecallicles
committed
chore(c15t): drop leftover 1.x naming
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Nicolas Joseph <nicolas@fiveonefour.com>
1 parent 8872327 commit 084f9df

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

components/consent-provider.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ const options: ConsentManagerOptions = backendURL
7373

7474
function 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
}

0 commit comments

Comments
 (0)