do not reset posthog users everytime someone is unauthenticated
This commit is contained in:
parent
6f0b811d67
commit
e3a231bba5
2 changed files with 6 additions and 3 deletions
|
|
@ -26,6 +26,11 @@ export default function ProfileMenu() {
|
|||
});
|
||||
};
|
||||
|
||||
const handleSignOut = () => {
|
||||
if (posthog?.__loaded) posthog?.reset();
|
||||
void signOut();
|
||||
};
|
||||
|
||||
return (
|
||||
<Menu as="div" className="relative inline-block text-left">
|
||||
<Menu.Button className="flex rounded-full bg-gray-800 text-sm focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800">
|
||||
|
|
@ -67,7 +72,7 @@ export default function ProfileMenu() {
|
|||
<Menu.Item>
|
||||
{({ active }) => (
|
||||
<div
|
||||
onClick={() => 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" : ""
|
||||
}`}
|
||||
|
|
|
|||
|
|
@ -59,8 +59,6 @@ const PostHogIdentificationWrapper = ({
|
|||
email,
|
||||
stripeSubscriptionStatus,
|
||||
});
|
||||
} else if (status === "unauthenticated") {
|
||||
posthog?.reset();
|
||||
}
|
||||
}, [posthog, session, status]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue