From 14b717f985f2b37152662976ec32b1efcbbf3fa1 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Wed, 19 Feb 2025 10:54:05 +0100 Subject: [PATCH] fix: half screen black on login --- app/login.tsx | 6 ++++-- providers/JellyfinProvider.tsx | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/login.tsx b/app/login.tsx index 662a48e0..9e954613 100644 --- a/app/login.tsx +++ b/app/login.tsx @@ -19,6 +19,7 @@ import { TouchableOpacity, View, } from "react-native"; +import { Keyboard } from "react-native"; import { z } from "zod"; import { t } from "i18next"; @@ -38,7 +39,7 @@ const Login: React.FC = () => { username: _username, password: _password, } = params as { apiUrl: string; username: string; password: string }; - + const [loadingServerCheck, setLoadingServerCheck] = useState(false); const [loading, setLoading] = useState(false); const [serverURL, setServerURL] = useState(_apiUrl); @@ -92,6 +93,8 @@ const Login: React.FC = () => { }, [serverName, navigation, api?.basePath]); const handleLogin = async () => { + Keyboard.dismiss(); + setLoading(true); try { const result = CredentialsSchema.safeParse(credentials); @@ -112,7 +115,6 @@ const Login: React.FC = () => { } }; - /** * Checks the availability and validity of a Jellyfin server URL. * diff --git a/providers/JellyfinProvider.tsx b/providers/JellyfinProvider.tsx index 4e6d6e99..66d1966e 100644 --- a/providers/JellyfinProvider.tsx +++ b/providers/JellyfinProvider.tsx @@ -303,6 +303,7 @@ export const JellyfinProvider: React.FC<{ children: ReactNode }> = ({ mutationFn: async () => { storage.delete("token"); setUser(null); + setApi(null); setPluginSettings(undefined); await clearAllJellyseerData(); },