feat(lint): use biome instead
This commit is contained in:
1 parent
dca2a31639
commit
8d68eb546d
129 files changed
+2352
-4366
No files matched your search
@@ -5,31 +5,28 @@ import { useNavigate } from "react-router-dom";
|
||||
|
||||
import { setDefaultServer, setServer } from "../../../utils/storage/servers";
|
||||
|
||||
import LoadingButton from "@mui/lab/LoadingButton";
|
||||
import Container from "@mui/material/Container";
|
||||
import Grid from "@mui/material/Grid";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
// MUI
|
||||
import TextField from "@mui/material/TextField";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Grid from "@mui/material/Grid";
|
||||
import LoadingButton from "@mui/lab/LoadingButton";
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
import Container from "@mui/material/Container";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
|
||||
import { mdiChevronRight } from "@mdi/js";
|
||||
|
||||
import { useSnackbar } from "notistack";
|
||||
|
||||
import { yellow } from "@mui/material/colors";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { MdiInformation } from "../../../components/icons/mdiInformation.jsx";
|
||||
import { createApi, useApi } from "../../../utils/store/api";
|
||||
// SCSS
|
||||
import "./server.module.scss";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { createApi, useApi } from "../../../utils/store/api";
|
||||
import { MdiInformation } from "../../../components/icons/mdiInformation.jsx";
|
||||
import { yellow } from "@mui/material/colors";
|
||||
|
||||
export const ServerSetup = () => {
|
||||
|
||||
const [jellyfin] = useApi((state) => [
|
||||
state.jellyfin,
|
||||
]);
|
||||
const [jellyfin] = useApi((state) => [state.jellyfin]);
|
||||
|
||||
const [serverIp, setServerIp] = useState("");
|
||||
|
||||
@@ -37,13 +34,10 @@ export const ServerSetup = () => {
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
|
||||
const checkServer = useMutation({
|
||||
mutationFn: async () => {
|
||||
const servers =
|
||||
await jellyfin.discovery.getRecommendedServerCandidates(
|
||||
serverIp,
|
||||
);
|
||||
await jellyfin.discovery.getRecommendedServerCandidates(serverIp);
|
||||
const bestServer = jellyfin.discovery.findBestServer(servers);
|
||||
return bestServer;
|
||||
},
|
||||
@@ -69,12 +63,9 @@ export const ServerSetup = () => {
|
||||
onSettled: (bestServer) => {
|
||||
console.log(bestServer);
|
||||
if (!bestServer) {
|
||||
enqueueSnackbar(
|
||||
`Provided server address is not a Jellyfin server.`,
|
||||
{
|
||||
variant: "error",
|
||||
},
|
||||
);
|
||||
enqueueSnackbar("Provided server address is not a Jellyfin server.", {
|
||||
variant: "error",
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -118,7 +109,7 @@ export const ServerSetup = () => {
|
||||
onChange={(event) => {
|
||||
setServerIp(event.target.value);
|
||||
}}
|
||||
></TextField>
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xl={5} md={6} sx={{ width: "100%" }}>
|
||||
<LoadingButton
|
||||
@@ -128,7 +119,7 @@ export const ServerSetup = () => {
|
||||
loading={checkServer.isPending}
|
||||
endIcon={
|
||||
<SvgIcon>
|
||||
<path d={mdiChevronRight}></path>
|
||||
<path d={mdiChevronRight} />
|
||||
</SvgIcon>
|
||||
}
|
||||
loadingPosition="end"
|
||||
|
||||
Reference in new issue
Block a user