Fix priority input for provider manage edit modal

This commit is contained in:
Qstick 2023-05-27 19:57:00 -05:00
parent b06269544c
commit 593652a84a
3 changed files with 5 additions and 5 deletions

View File

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

View File

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

View File

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