Skip to content

Commit

Permalink
Hide sequential checkbox for old servers
Browse files Browse the repository at this point in the history
Issue #122
  • Loading branch information
qu1ck committed Dec 11, 2023
1 parent f3a5e26 commit 29830b6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/modals/edittorrent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -40,6 +40,7 @@ interface FormValues {
}

export function EditTorrent(props: ModalState) {
const rpcVersion = useServerRpcVersion();
const serverData = useServerTorrentData();
const selected = useServerSelectedTorrents();

Expand Down Expand Up @@ -120,9 +121,10 @@ export function EditTorrent(props: ModalState) {
{...form.getInputProps("honorsSessionLimits", { type: "checkbox" })} />
</Grid.Col>
<Grid.Col span={4}>
<Checkbox my="sm"
label="Sequential download"
{...form.getInputProps("sequentialDownload", { type: "checkbox" })} />
{rpcVersion >= 18 &&
<Checkbox my="sm"
label="Sequential download"
{...form.getInputProps("sequentialDownload", { type: "checkbox" })} />}
</Grid.Col>
<Grid.Col span={8}>
<Checkbox
Expand Down

0 comments on commit 29830b6

Please sign in to comment.