(event: Event)
| 38 | } |
| 39 | postReading(ReadingAction.Preference, { inApp: !isOptedOut }); |
| 40 | const onPreference = (event: Event) => { |
| 41 | const { inApp } = |
| 42 | (event as CustomEvent<{ inApp?: boolean }>).detail ?? {}; |
| 43 | if (typeof inApp === 'boolean' && inApp === isOptedOut) { |
| 44 | setOptedOutRef.current(!inApp); |
| 45 | } |
| 46 | }; |
| 47 | window.addEventListener(ReadingEvent.Preference, onPreference); |
| 48 | return () => |
| 49 | window.removeEventListener(ReadingEvent.Preference, onPreference); |
nothing calls this directly
no outgoing calls
no test coverage detected