* Check if user has opted out of analytics * Reads directly from localStorage to avoid circular dependencies
()
| 26 | * Reads directly from localStorage to avoid circular dependencies |
| 27 | */ |
| 28 | function isOptedOut(): boolean { |
| 29 | try { |
| 30 | const optOut = localStorage.getItem("preferences:analytics-opt-out") |
| 31 | return optOut === "true" |
| 32 | } catch { |
| 33 | return false |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Get common properties for all events |