Revert "Merge pull request #686 from AnishSarkar22/feat/replace-logs"

This reverts commit 5963a1125e, reversing
changes made to 0d2a2f8ea1.
This commit is contained in:
DESKTOP-RTLN3BA\$punk 2026-01-16 00:49:33 -08:00
parent 5963a1125e
commit 3418c0e026
84 changed files with 4613 additions and 8266 deletions

View file

@ -13,7 +13,6 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { cleanupElectric } from "@/lib/electric/client";
import { resetUser, trackLogout } from "@/lib/posthog/events";
export function UserDropdown({
@ -27,20 +26,12 @@ export function UserDropdown({
}) {
const router = useRouter();
const handleLogout = async () => {
const handleLogout = () => {
try {
// Track logout event and reset PostHog identity
trackLogout();
resetUser();
// Best-effort cleanup of Electric SQL / PGlite
// Even if this fails, login-time cleanup will handle it
try {
await cleanupElectric();
} catch (err) {
console.warn("[Logout] Electric cleanup failed (will be handled on next login):", err);
}
if (typeof window !== "undefined") {
localStorage.removeItem("surfsense_bearer_token");
window.location.href = "/";
@ -49,7 +40,7 @@ export function UserDropdown({
console.error("Error during logout:", error);
// Optionally, provide user feedback
if (typeof window !== "undefined") {
localStorage.removeItem("surfsense_bearer_token");
alert("Logout failed. Please try again.");
window.location.href = "/";
}
}