diff --git a/src/components/ProfileMenu.tsx b/src/components/ProfileMenu.tsx index 8a38a0d..7aee3d5 100644 --- a/src/components/ProfileMenu.tsx +++ b/src/components/ProfileMenu.tsx @@ -26,6 +26,11 @@ export default function ProfileMenu() { }); }; + const handleSignOut = () => { + if (posthog?.__loaded) posthog?.reset(); + void signOut(); + }; + return ( @@ -67,7 +72,7 @@ export default function ProfileMenu() { {({ active }) => (
void signOut()} + onClick={handleSignOut} className={`mx-2 flex h-8 w-40 cursor-pointer flex-row content-center rounded-md p-2 ${ active ? "bg-gray-100" : "" }`} diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 4ca0309..b003768 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -59,8 +59,6 @@ const PostHogIdentificationWrapper = ({ email, stripeSubscriptionStatus, }); - } else if (status === "unauthenticated") { - posthog?.reset(); } }, [posthog, session, status]);