chore: Cleanup unused vars, exports, types * Cleanup some unused exports * Remove more * Readd CampaignPageIncludedHotelsRef * Add alias comment to procedure exports * Remove unused exports Approved-by: Linus Flood
20 lines
662 B
TypeScript
20 lines
662 B
TypeScript
export const profilingConsentOpenEvent = "profiling-consent:open"
|
|
|
|
const storageKey = (memberKey: string) =>
|
|
`profiling-consent:dismissed:${memberKey}`
|
|
|
|
export function readDismissed(memberKey: string): boolean {
|
|
if (!memberKey || typeof window === "undefined") return false
|
|
return localStorage.getItem(storageKey(memberKey)) === "1"
|
|
}
|
|
|
|
export function setDismissed(memberKey: string): void {
|
|
if (!memberKey || typeof window === "undefined") return
|
|
localStorage.setItem(storageKey(memberKey), "1")
|
|
}
|
|
|
|
export function requestOpen(): void {
|
|
if (typeof window === "undefined") return
|
|
window.dispatchEvent(new CustomEvent(profilingConsentOpenEvent))
|
|
}
|