mirror of
https://github.com/Jellify-Music/App.git
synced 2026-02-13 22:18:32 -06:00
ok
This commit is contained in:
@@ -33,13 +33,13 @@ export const mutateServer = async (server?: JellifyServer) => {
|
||||
return await AsyncStorage.removeItem(AsyncStorageKeys.ServerUrl);
|
||||
}
|
||||
|
||||
export const mutateServerCredentials = async (credentials?: JellyfinCredentials) => {
|
||||
export const mutateServerCredentials = async (serverUrl: string, credentials?: JellyfinCredentials) => {
|
||||
|
||||
if (!_.isUndefined(credentials)) {
|
||||
console.log("Setting Jellyfin credentials")
|
||||
return await Keychain.setInternetCredentials((await fetchServer()).url, credentials.username, credentials.accessToken!);
|
||||
return await Keychain.setInternetCredentials(serverUrl, credentials.username, credentials.accessToken!);
|
||||
}
|
||||
|
||||
console.log("Resetting Jellyfin credentials")
|
||||
return await Keychain.resetInternetCredentials((await fetchServer()).url);
|
||||
return await Keychain.resetInternetCredentials(serverUrl);
|
||||
}
|
||||
@@ -19,7 +19,7 @@ export default function ServerLibrary(): React.JSX.Element {
|
||||
|
||||
const [musicLibrary, setMusicLibrary] = useState<JellifyLibrary | undefined>(undefined);
|
||||
|
||||
const { setUsername, setChangeUsername, libraryName, setLibraryName, libraryId, setLibraryId } = useAuthenticationContext();
|
||||
const { server, setUsername, setChangeUsername, libraryName, setLibraryName, libraryId, setLibraryId } = useAuthenticationContext();
|
||||
|
||||
const { apiClient, refetchApi } = useApiClientContext();
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function ServerLibrary(): React.JSX.Element {
|
||||
|
||||
const clearUser = useMutation({
|
||||
mutationFn: async () => {
|
||||
await mutateServerCredentials();
|
||||
await mutateServerCredentials(server!.url);
|
||||
setChangeUsername(true);
|
||||
return await refetchApi()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user