mirror of
https://github.com/Jellify-Music/App.git
synced 2026-04-30 15:39:30 -05:00
PLZ lemme go back
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import React, { useState } from "react";
|
||||
import { useApiClientContext } from "../../jellyfin-api-provider";
|
||||
import { Select, View } from "tamagui";
|
||||
import { JellifyLibrary } from "../../../types/JellifyLibrary";
|
||||
@@ -8,7 +8,6 @@ import { useAuthenticationContext } from "../provider";
|
||||
import { Heading } from "../../helpers/text";
|
||||
import Button from "../../helpers/button";
|
||||
import _ from "lodash";
|
||||
import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models/base-item-dto";
|
||||
import { Api } from "@jellyfin/sdk";
|
||||
import { fetchMusicLibraries } from "../../../api/queries/functions/libraries";
|
||||
import { QueryKeys } from "../../../enums/query-keys";
|
||||
@@ -19,7 +18,7 @@ export default function ServerLibrary(): React.JSX.Element {
|
||||
|
||||
const [musicLibrary, setMusicLibrary] = useState<JellifyLibrary | undefined>(undefined);
|
||||
|
||||
const { setUsername, libraryName, setLibraryName, libraryId, setLibraryId } = useAuthenticationContext();
|
||||
const { setChangeUsername, libraryName, setLibraryName, libraryId, setLibraryId } = useAuthenticationContext();
|
||||
|
||||
const { apiClient } = useApiClientContext();
|
||||
|
||||
@@ -31,15 +30,6 @@ export default function ServerLibrary(): React.JSX.Element {
|
||||
|
||||
const { data : libraries, isPending, refetch } = useLibraries(apiClient!);
|
||||
|
||||
const clearUser = useMutation({
|
||||
mutationFn: async () => {
|
||||
|
||||
setUsername(undefined);
|
||||
|
||||
return Promise.resolve();
|
||||
}
|
||||
});
|
||||
|
||||
const serverCredentials = useMutation({
|
||||
mutationFn: mutateServerCredentials
|
||||
});
|
||||
@@ -82,10 +72,7 @@ export default function ServerLibrary(): React.JSX.Element {
|
||||
}
|
||||
|
||||
<Button
|
||||
onPress={() => {
|
||||
serverCredentials.mutate(undefined);
|
||||
clearUser.mutate();
|
||||
}}
|
||||
onPress={() => setChangeUsername(true)}
|
||||
>
|
||||
Switch User
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user