mirror of
https://github.com/anultravioletaurora/Jellify.git
synced 2026-01-06 13:50:58 -06:00
fix sign in
This commit is contained in:
@@ -10,10 +10,10 @@ import { JellifyLibrary } from "../types/JellifyLibrary";
|
||||
export default class Client {
|
||||
static #instance: Client;
|
||||
|
||||
private api : Api | undefined;
|
||||
private user : JellifyUser | undefined;
|
||||
private server : JellifyServer | undefined;
|
||||
private library : JellifyLibrary | undefined;
|
||||
private api : Api | undefined = undefined;
|
||||
private user : JellifyUser | undefined = undefined;
|
||||
private server : JellifyServer | undefined = undefined;
|
||||
private library : JellifyLibrary | undefined = undefined;
|
||||
private sessionId : string = uuid.v4();
|
||||
|
||||
private constructor(
|
||||
|
||||
@@ -2,10 +2,9 @@ import React, { useState } from "react";
|
||||
import _ from "lodash";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { JellifyServer } from "../../../types/JellifyServer";
|
||||
import { Spacer, Spinner, XStack, ZStack } from "tamagui";
|
||||
import { Input, Spacer, Spinner, XStack, ZStack } from "tamagui";
|
||||
import { SwitchWithLabel } from "../../Global/helpers/switch-with-label";
|
||||
import { H1 } from "../../Global/helpers/text";
|
||||
import Input from "../../Global/helpers/input";
|
||||
import Button from "../../Global/helpers/button";
|
||||
import { http, https } from "../utils/constants";
|
||||
import { JellyfinInfo } from "../../../api/info";
|
||||
@@ -76,8 +75,6 @@ export default function ServerAddress(): React.JSX.Element {
|
||||
<Spacer />
|
||||
|
||||
<Input
|
||||
value={serverAddress}
|
||||
placeholder="jellyfin.org"
|
||||
onChangeText={setServerAddress}
|
||||
autoCapitalize="none"
|
||||
autoCorrect={false}
|
||||
|
||||
@@ -2,11 +2,10 @@ import React, { useState } from "react";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import _ from "lodash";
|
||||
import { JellyfinCredentials } from "../../../api/types/jellyfin-credentials";
|
||||
import { Spinner, YStack, ZStack } from "tamagui";
|
||||
import { Input, Spinner, YStack, ZStack } from "tamagui";
|
||||
import { useAuthenticationContext } from "../provider";
|
||||
import { H1 } from "../../Global/helpers/text";
|
||||
import Button from "../../Global/helpers/button";
|
||||
import Input from "../../Global/helpers/input";
|
||||
import { SafeAreaView } from "react-native-safe-area-context";
|
||||
import Client from "../../../api/client";
|
||||
import { JellifyUser } from "../../../types/JellifyUser";
|
||||
@@ -67,14 +66,14 @@ export default function ServerAuthentication(): React.JSX.Element {
|
||||
<Input
|
||||
placeholder="Username"
|
||||
value={username}
|
||||
onChangeText={(value) => setUsername(value)}
|
||||
onChangeText={(value : string | undefined) => setUsername(value)}
|
||||
autoCapitalize="none"
|
||||
autoCorrect={false}
|
||||
/>
|
||||
<Input
|
||||
placeholder="Password"
|
||||
value={password}
|
||||
onChangeText={(value) => setPassword(value)}
|
||||
onChangeText={(value : string | undefined) => setPassword(value)}
|
||||
autoCapitalize="none"
|
||||
autoCorrect={false}
|
||||
secureTextEntry
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useState } from "react";
|
||||
import { Spinner, Text, ToggleGroup } from "tamagui";
|
||||
import { Spinner, ToggleGroup } from "tamagui";
|
||||
import { useAuthenticationContext } from "../provider";
|
||||
import { H1, Label } from "../../Global/helpers/text";
|
||||
import { H1, Label, Text } from "../../Global/helpers/text";
|
||||
import Button from "../../Global/helpers/button";
|
||||
import _ from "lodash";
|
||||
import { useMusicLibraries, usePlaylistLibrary } from "../../../api/queries/libraries";
|
||||
@@ -27,21 +27,24 @@ export default function ServerLibrary(): React.JSX.Element {
|
||||
{ isPending ? (
|
||||
<Spinner size="large" />
|
||||
) : (
|
||||
<ToggleGroup
|
||||
orientation="vertical"
|
||||
type="single"
|
||||
disableDeactivation={true}
|
||||
value={libraryId}
|
||||
onValueChange={setLibraryId}
|
||||
>
|
||||
{ libraries!.map((library) => {
|
||||
return (
|
||||
<ToggleGroup.Item value={library.Id!} aria-label={library.Name!}>
|
||||
<Label htmlFor={library.Id!} size="$2">{library.Name!}</Label>
|
||||
</ToggleGroup.Item>
|
||||
)
|
||||
})}
|
||||
</ToggleGroup>
|
||||
<>
|
||||
{/* @ts-ignore */}
|
||||
<ToggleGroup
|
||||
orientation="vertical"
|
||||
type="single"
|
||||
disableDeactivation={true}
|
||||
value={libraryId}
|
||||
onValueChange={setLibraryId}
|
||||
>
|
||||
{ libraries!.map((library) => {
|
||||
return (
|
||||
<ToggleGroup.Item value={library.Id!} aria-label={library.Name!}>
|
||||
<Label htmlFor={library.Id!} size="$2">{library.Name!}</Label>
|
||||
</ToggleGroup.Item>
|
||||
)
|
||||
})}
|
||||
</ToggleGroup>
|
||||
</>
|
||||
)}
|
||||
|
||||
{ isError && (
|
||||
|
||||
Reference in New Issue
Block a user