Skip to content

Commit

Permalink
add opt out in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
chuyouchia committed May 6, 2024
1 parent a44af8c commit d3f7ee9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ if (await window.electronStore.getAnalyticsMode()) {
posthog.init("phc_xi4hFToX1cZU657yzge1VW0XImaaRzuvnFUdbAKI8fu", {
api_host: "https://us.i.posthog.com",
});
console.log("initializing posthog");
}

interface AppProps {}
Expand Down
6 changes: 5 additions & 1 deletion src/components/Settings/AnalyticsSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState, useEffect } from "react";
import { Button } from "@material-tailwind/react";
import Switch from "@mui/material/Switch";
import posthog from "posthog-js";

interface AnalyticsSettingsProps {}
const AnalyticsSettings: React.FC<AnalyticsSettingsProps> = () => {
Expand Down Expand Up @@ -36,8 +37,11 @@ const AnalyticsSettings: React.FC<AnalyticsSettingsProps> = () => {
onChange={() => {
setUserHasMadeUpdate(true);
setIsAnalyticsEnabled(!isAnalyticsEnabled);
if (isAnalyticsEnabled) {
posthog.capture("analytics_disabled");
}
}}
// inputProps={{ "aria-label": "controlled" }}
inputProps={{ "aria-label": "controlled" }}
/>
{userHasMadeUpdate && (
<div className="flex">
Expand Down

0 comments on commit d3f7ee9

Please sign in to comment.