Fix priority input for provider manage edit modal

(cherry picked from commit 593652a84a45aea7b542e682c08453f4ee88871c)
pull/8623/head
Qstick 1 year ago
parent 1d4b6d4cad
commit 4fc1ee0aff

@ -10,7 +10,7 @@ function parseValue(props, value) {
} = props;
if (value == null || value === '') {
return min;
return null;
}
let newValue = isFloat ? parseFloat(value) : parseInt(value);

@ -41,7 +41,7 @@ function ManageDownloadClientsEditModalContent(
const [removeCompletedDownloads, setRemoveCompletedDownloads] =
useState(NO_CHANGE);
const [removeFailedDownloads, setRemoveFailedDownloads] = useState(NO_CHANGE);
const [priority, setPriority] = useState<string | number>(NO_CHANGE);
const [priority, setPriority] = useState<null | string | number>(null);
const save = useCallback(() => {
let hasChanges = false;
@ -62,7 +62,7 @@ function ManageDownloadClientsEditModalContent(
payload.removeFailedDownloads = removeFailedDownloads === 'enabled';
}
if (priority !== NO_CHANGE) {
if (priority !== null) {
hasChanges = true;
payload.priority = priority as number;
}

@ -41,7 +41,7 @@ function ManageIndexersEditModalContent(
const [enableAutomaticSearch, setEnableAutomaticSearch] = useState(NO_CHANGE);
const [enableInteractiveSearch, setEnableInteractiveSearch] =
useState(NO_CHANGE);
const [priority, setPriority] = useState<string | number>(NO_CHANGE);
const [priority, setPriority] = useState<null | string | number>(null);
const save = useCallback(() => {
let hasChanges = false;
@ -62,7 +62,7 @@ function ManageIndexersEditModalContent(
payload.enableInteractiveSearch = enableInteractiveSearch === 'enabled';
}
if (priority !== NO_CHANGE) {
if (priority !== null) {
hasChanges = true;
payload.priority = priority as number;
}

Loading…
Cancel
Save