From 29830b6bcc6082c438ce5f491993c1e22a82a361 Mon Sep 17 00:00:00 2001 From: qu1ck Date: Mon, 11 Dec 2023 08:11:11 -0800 Subject: [PATCH] Hide sequential checkbox for old servers Issue #122 --- src/components/modals/edittorrent.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/modals/edittorrent.tsx b/src/components/modals/edittorrent.tsx index a651c5a..03e9718 100644 --- a/src/components/modals/edittorrent.tsx +++ b/src/components/modals/edittorrent.tsx @@ -23,7 +23,7 @@ import { useForm } from "@mantine/form"; import { useMutateTorrent, useTorrentDetails } from "queries"; import { notifications } from "@mantine/notifications"; import { Checkbox, Grid, LoadingOverlay, NumberInput } from "@mantine/core"; -import { useServerSelectedTorrents, useServerTorrentData } from "rpc/torrent"; +import { useServerRpcVersion, useServerSelectedTorrents, useServerTorrentData } from "rpc/torrent"; interface FormValues { downloadLimited?: boolean, @@ -40,6 +40,7 @@ interface FormValues { } export function EditTorrent(props: ModalState) { + const rpcVersion = useServerRpcVersion(); const serverData = useServerTorrentData(); const selected = useServerSelectedTorrents(); @@ -120,9 +121,10 @@ export function EditTorrent(props: ModalState) { {...form.getInputProps("honorsSessionLimits", { type: "checkbox" })} /> - + {rpcVersion >= 18 && + }