mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 08:43:48 +03:00
refactor: changed selectedPath from an object to a string
This commit is contained in:
parent
e860b8aeaa
commit
fca84f7c90
@ -23,9 +23,7 @@ export function SelectFolderModal({
|
|||||||
}: SelectFolderModalProps) {
|
}: SelectFolderModalProps) {
|
||||||
const { t } = useTranslation("game_details");
|
const { t } = useTranslation("game_details");
|
||||||
|
|
||||||
const [selectedPath, setSelectedPath] = useState({
|
const [selectedPath, setSelectedPath] = useState(null);
|
||||||
downloadsPath: "",
|
|
||||||
});
|
|
||||||
const [downloadStarting, setDownloadStarting] = useState(false);
|
const [downloadStarting, setDownloadStarting] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -33,9 +31,7 @@ export function SelectFolderModal({
|
|||||||
window.electron.getDefaultDownloadsPath(),
|
window.electron.getDefaultDownloadsPath(),
|
||||||
window.electron.getUserPreferences(),
|
window.electron.getUserPreferences(),
|
||||||
]).then(([path, userPreferences]) => {
|
]).then(([path, userPreferences]) => {
|
||||||
setSelectedPath({
|
setSelectedPath(userPreferences?.downloadsPath || path);
|
||||||
downloadsPath: userPreferences?.downloadsPath || path,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@ -47,7 +43,7 @@ export function SelectFolderModal({
|
|||||||
|
|
||||||
if (filePaths && filePaths.length > 0) {
|
if (filePaths && filePaths.length > 0) {
|
||||||
const path = filePaths[0];
|
const path = filePaths[0];
|
||||||
setSelectedPath({ downloadsPath: path });
|
setSelectedPath(path);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user