feat: update user ga events

This commit is contained in:
AykutSarac 2024-05-09 17:34:10 +03:00
parent 4a5dcfb704
commit f3a56348c1
No known key found for this signature in database

View File

@ -27,7 +27,14 @@ const useUser = create<UserStates & UserActions>()(set => ({
},
logout: async () => {
toast.loading("Logging out...", { id: "logout" });
await supabase.auth.signOut();
const { error } = await supabase.auth.signOut({ scope: "local" });
if (error) {
toast.error("Failed to log out.");
return;
}
gaEvent("engagement", "logout");
set(initialStates);
toast.success("Logged out.", { id: "logout" });
},