diff --git a/src/routes/_api/login/list.tsx b/src/routes/_api/login/list.tsx index cc37989..b521dea 100644 --- a/src/routes/_api/login/list.tsx +++ b/src/routes/_api/login/list.tsx @@ -1,21 +1,18 @@ import { useQuery } from "@tanstack/react-query"; -import React, { useLayoutEffect } from "react"; +import React, { useEffect } from "react"; -import { Chip, IconButton, Typography } from "@mui/material"; -import Button from "@mui/material/Button"; +import { Chip, Typography } from "@mui/material"; -import { AppBarBackOnly } from "@/components/appBar/backOnly.jsx"; import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api"; import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice.jsx"; import "./login.scss"; -import QuickConnectButton from "@/components/buttons/quickConnectButton"; import { useApiInContext } from "@/utils/store/api"; import { useBackdropStore } from "@/utils/store/backdrop.js"; import type { UserDto } from "@jellyfin/sdk/lib/generated-client"; -import { Link, createFileRoute, useNavigate } from "@tanstack/react-router"; +import { Link, createFileRoute } from "@tanstack/react-router"; import avatar from "../../../assets/icons/avatar.png"; @@ -36,7 +33,7 @@ const UserCard = ({ user }: { user: UserDto }) => { {"user"} ) : ( user @@ -50,13 +47,8 @@ const UserCard = ({ user }: { user: UserDto }) => { } function LoginPublicUsersList() { - const navigate = useNavigate(); - const api = useApiInContext((s) => s.api); - const handleChangeServer = () => { - navigate({ to: "/setup/server/list" }); - }; const users = useQuery({ queryKey: ["login", "public-users"], queryFn: async () => { @@ -67,11 +59,11 @@ function LoginPublicUsersList() { enabled: Boolean(api), }); - const setBackdrop = useBackdropStore((state) => state.setBackdrop); - - useLayoutEffect(() => { + const setBackdrop = useBackdropStore((state) => state.setBackdrop); + useEffect(() => { setBackdrop("", ""); }, []); + if (users.isSuccess) { return (
@@ -85,17 +77,6 @@ function LoginPublicUsersList() { })}
- {/*
- - -
*/} { + return { redirect: String(search.redirect) }; + }, }); function UserLoginManual() { @@ -49,7 +50,7 @@ function UserLoginManual() { const server = useQuery({ queryKey: ["login", "manual", "serverInfo"], queryFn: async () => - api ? (await getBrandingApi(api).getBrandingOptions()).data : skipToken, + api ? (await getBrandingApi(api).getBrandingOptions()).data : null, }); const navigate = useNavigate(); @@ -64,12 +65,14 @@ function UserLoginManual() { password: "", }); - const handlePassword = (prop: "password" | "showpass") => (event) => { - setPassword({ - ...password, - [prop]: event.target.value, - }); - }; + const handlePassword = + (prop: "password" | "showpass") => + (event: ChangeEvent) => { + setPassword({ + ...password, + [prop]: event.target.value, + }); + }; const handleShowPassword = () => { setPassword({ @@ -199,7 +202,7 @@ function UserLoginManual() { - {server.isSuccess && server.data.LoginDisclaimer && ( + {server.isSuccess && server.data?.LoginDisclaimer && (