mirror of
https://github.com/AykutSarac/jsoncrack.com.git
synced 2025-02-04 01:32:54 +08:00
feat: update user ga events
This commit is contained in:
parent
4a5dcfb704
commit
f3a56348c1
@ -27,7 +27,14 @@ const useUser = create<UserStates & UserActions>()(set => ({
|
|||||||
},
|
},
|
||||||
logout: async () => {
|
logout: async () => {
|
||||||
toast.loading("Logging out...", { id: "logout" });
|
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);
|
set(initialStates);
|
||||||
toast.success("Logged out.", { id: "logout" });
|
toast.success("Logged out.", { id: "logout" });
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user