Skip to content

Commit 1ce3ae7

Browse files
markrickertmorganick
authored andcommitted
Send an opt-out event when the user opt-sout. Then no more logs.
1 parent 6fa3ad6 commit 1ce3ae7

File tree

1 file changed

+3
-0
lines changed
  • apps/reactotron-app/src/renderer/components/AnalyticsOptOut

1 file changed

+3
-0
lines changed

Diff for: apps/reactotron-app/src/renderer/components/AnalyticsOptOut/index.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import styled, { useTheme } from "styled-components"
33
import FadeIn from "react-fade-in"
44
import { reactotronAnalytics } from "../../images"
55
import configStore from "../../config"
6+
import { useAnalytics } from "../../util/analyticsHelpers"
67

78
const Overlay = styled.div`
89
position: absolute;
@@ -62,6 +63,7 @@ const Button = styled.button`
6263
// We use this instead of the default alert because we want to style it to match our app.
6364
const AnalyticsOptOut = ({ onClose }) => {
6465
const theme = useTheme()
66+
const { sendOptOutAnalyticsEvent } = useAnalytics()
6567

6668
return (
6769
<FadeIn wrapperTag={Overlay}>
@@ -85,6 +87,7 @@ const AnalyticsOptOut = ({ onClose }) => {
8587
<Button
8688
onClick={() => {
8789
configStore.set("analyticsOptOut", true)
90+
sendOptOutAnalyticsEvent()
8891
onClose()
8992
}}
9093
style={{

0 commit comments

Comments
 (0)