From 593652a84a45aea7b542e682c08453f4ee88871c Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 27 May 2023 19:57:00 -0500 Subject: [PATCH] Fix priority input for provider manage edit modal --- frontend/src/Components/Form/NumberInput.js | 2 +- .../Manage/Edit/ManageDownloadClientsEditModalContent.tsx | 4 ++-- .../Indexers/Manage/Edit/ManageIndexersEditModalContent.tsx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/Components/Form/NumberInput.js b/frontend/src/Components/Form/NumberInput.js index 8db1cd7b6..454aad997 100644 --- a/frontend/src/Components/Form/NumberInput.js +++ b/frontend/src/Components/Form/NumberInput.js @@ -10,7 +10,7 @@ function parseValue(props, value) { } = props; if (value == null || value === '') { - return min; + return null; } let newValue = isFloat ? parseFloat(value) : parseInt(value); diff --git a/frontend/src/Settings/DownloadClients/DownloadClients/Manage/Edit/ManageDownloadClientsEditModalContent.tsx b/frontend/src/Settings/DownloadClients/DownloadClients/Manage/Edit/ManageDownloadClientsEditModalContent.tsx index 369a12b1a..0ba86e862 100644 --- a/frontend/src/Settings/DownloadClients/DownloadClients/Manage/Edit/ManageDownloadClientsEditModalContent.tsx +++ b/frontend/src/Settings/DownloadClients/DownloadClients/Manage/Edit/ManageDownloadClientsEditModalContent.tsx @@ -41,7 +41,7 @@ function ManageDownloadClientsEditModalContent( const [removeCompletedDownloads, setRemoveCompletedDownloads] = useState(NO_CHANGE); const [removeFailedDownloads, setRemoveFailedDownloads] = useState(NO_CHANGE); - const [priority, setPriority] = useState(NO_CHANGE); + const [priority, setPriority] = useState(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; } diff --git a/frontend/src/Settings/Indexers/Indexers/Manage/Edit/ManageIndexersEditModalContent.tsx b/frontend/src/Settings/Indexers/Indexers/Manage/Edit/ManageIndexersEditModalContent.tsx index b6613f7da..984f3a150 100644 --- a/frontend/src/Settings/Indexers/Indexers/Manage/Edit/ManageIndexersEditModalContent.tsx +++ b/frontend/src/Settings/Indexers/Indexers/Manage/Edit/ManageIndexersEditModalContent.tsx @@ -41,7 +41,7 @@ function ManageIndexersEditModalContent( const [enableAutomaticSearch, setEnableAutomaticSearch] = useState(NO_CHANGE); const [enableInteractiveSearch, setEnableInteractiveSearch] = useState(NO_CHANGE); - const [priority, setPriority] = useState(NO_CHANGE); + const [priority, setPriority] = useState(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; }