From b6bd424bac8031941a4b84422feb2f95578a68c1 Mon Sep 17 00:00:00 2001 From: Hachi-R Date: Sat, 26 Apr 2025 13:49:02 -0300 Subject: [PATCH] fix: simplify automatic extraction value initialization --- .../game-details/modals/download-settings-modal.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/renderer/src/pages/game-details/modals/download-settings-modal.tsx b/src/renderer/src/pages/game-details/modals/download-settings-modal.tsx index 9293071f..c0ea5df1 100644 --- a/src/renderer/src/pages/game-details/modals/download-settings-modal.tsx +++ b/src/renderer/src/pages/game-details/modals/download-settings-modal.tsx @@ -38,21 +38,13 @@ export function DownloadSettingsModal({ (state) => state.userPreferences.value ); - const getAutomaticExtractionValue = () => { - if (userPreferences?.extractFilesByDefault === undefined) { - window.electron.updateUserPreferences({ extractFilesByDefault: true }); - } - - return userPreferences?.extractFilesByDefault ?? true; - }; - const { showErrorToast } = useToast(); const [diskFreeSpace, setDiskFreeSpace] = useState(null); const [selectedPath, setSelectedPath] = useState(""); const [downloadStarting, setDownloadStarting] = useState(false); const [automaticExtractionEnabled, setAutomaticExtractionEnabled] = useState( - getAutomaticExtractionValue() + userPreferences?.extractFilesByDefault ?? true ); const [selectedDownloader, setSelectedDownloader] = useState(null);