This should pop the server auth screen when we navigate away from the login page

This commit is contained in:
Violet Caulfield
2024-10-17 09:32:29 -05:00
parent 7815173e03
commit 7a665b3c6f
2 changed files with 4 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ import { useApiClientContext } from "../jellyfin-api-provider";
export default function Login(): React.JSX.Element {
const { server } = useApiClientContext();
const { server, changeServer } = useApiClientContext();
const Stack = createStackNavigator();
@@ -17,7 +17,8 @@ export default function Login(): React.JSX.Element {
<Stack.Screen
name="ServerAddress"
options={{
title: "Enter your Jellyfin server"
title: "Enter your Jellyfin server",
animationTypeForReplace: changeServer ? 'pop' : 'push'
}}
component={ServerAddress}
>

View File

@@ -13,6 +13,7 @@ export default function ServerAuthentication(): React.JSX.Element {
const isDarkMode = useColorScheme() === 'dark';
const loginContext = useApiClientContext();
loginContext.setChangeServer(false);
const clearServer = useMutation({
mutationFn: async () => {