fix(mobile): logga ut ur Firebase vid utloggning (POLISH-1)
This commit is contained in:
@@ -2,6 +2,7 @@ import { Alert } from "react-native";
|
||||
import { router } from "expo-router";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { api } from "@/lib/api";
|
||||
import { firebaseAuthProvider } from "@/lib/auth-provider/firebase";
|
||||
import { persistLanguageTag, useAuth } from "@/lib/auth";
|
||||
import { SUPPORTED_LANGUAGES, t } from "@/lib/i18n";
|
||||
import {
|
||||
@@ -59,7 +60,11 @@ const RELIGIOUS = ["none", "halal", "kosher", "hindu_no_beef", "buddhist_vegetar
|
||||
|
||||
export default function ProfileScreen() {
|
||||
const queryClient = useQueryClient();
|
||||
const logout = useAuth((s) => s.logout);
|
||||
const rawLogout = useAuth((s) => s.logout);
|
||||
const logout = async () => {
|
||||
await firebaseAuthProvider.signOut().catch(() => {});
|
||||
await rawLogout();
|
||||
};
|
||||
|
||||
const me = useQuery({ queryKey: ["me"], queryFn: () => api<Me>("/v1/me") });
|
||||
const entitlements = useQuery({
|
||||
|
||||
Reference in New Issue
Block a user