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 { router } from "expo-router";
|
||||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||||
import { api } from "@/lib/api";
|
import { api } from "@/lib/api";
|
||||||
|
import { firebaseAuthProvider } from "@/lib/auth-provider/firebase";
|
||||||
import { persistLanguageTag, useAuth } from "@/lib/auth";
|
import { persistLanguageTag, useAuth } from "@/lib/auth";
|
||||||
import { SUPPORTED_LANGUAGES, t } from "@/lib/i18n";
|
import { SUPPORTED_LANGUAGES, t } from "@/lib/i18n";
|
||||||
import {
|
import {
|
||||||
@@ -59,7 +60,11 @@ const RELIGIOUS = ["none", "halal", "kosher", "hindu_no_beef", "buddhist_vegetar
|
|||||||
|
|
||||||
export default function ProfileScreen() {
|
export default function ProfileScreen() {
|
||||||
const queryClient = useQueryClient();
|
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 me = useQuery({ queryKey: ["me"], queryFn: () => api<Me>("/v1/me") });
|
||||||
const entitlements = useQuery({
|
const entitlements = useQuery({
|
||||||
|
|||||||
Reference in New Issue
Block a user