mirror of
https://github.com/Jellify-Music/App.git
synced 2026-01-25 04:28:40 -06:00
adding a switch server button to library selection screen
This commit is contained in:
@@ -49,7 +49,7 @@ export default function ServerAuthentication(): React.JSX.Element {
|
||||
setChangeServer(true);
|
||||
return await AsyncStorage.setItem(AsyncStorageKeys.ServerUrl, "");
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
return (
|
||||
<View style={jellifyStyles.container}>
|
||||
|
||||
@@ -1,11 +1,35 @@
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import { Text } from "react-native-ui-lib";
|
||||
import { Button, Colors, Text } from "react-native-ui-lib";
|
||||
import { AsyncStorageKeys } from "../../../enums/async-storage-keys";
|
||||
import { useApiClientContext } from "../../jellyfin-api-provider";
|
||||
import AsyncStorage from "@react-native-async-storage/async-storage";
|
||||
|
||||
export default function ServerLibrary(): React.JSX.Element {
|
||||
|
||||
const { setServer, setChangeServer } = useApiClientContext();
|
||||
|
||||
const clearServer = useMutation({
|
||||
mutationFn: async () => {
|
||||
setServer(undefined)
|
||||
setChangeServer(true);
|
||||
return await AsyncStorage.setItem(AsyncStorageKeys.ServerUrl, "");
|
||||
}
|
||||
});
|
||||
return (
|
||||
<View>
|
||||
<Text style={{fontSize: 300 }}>Select Music Library</Text>
|
||||
<Text style={{fontSize: 30 }}>Select Music Library</Text>
|
||||
|
||||
<Button
|
||||
label="Switch Server"
|
||||
onPress={() => {
|
||||
clearServer.mutate();
|
||||
}}
|
||||
backgroundColor={Colors.$iconDanger}
|
||||
color={Colors.$white}
|
||||
/>
|
||||
|
||||
</View>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user