mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 21:44:55 +03:00
fix: cannot read properties of undefined in selectFolderModal
This commit is contained in:
parent
93ff4b8f7a
commit
5db7b97090
@ -23,7 +23,7 @@ export function SelectFolderModal({
|
|||||||
}: SelectFolderModalProps) {
|
}: SelectFolderModalProps) {
|
||||||
const { t } = useTranslation("game_details");
|
const { t } = useTranslation("game_details");
|
||||||
|
|
||||||
const [selectedPath, setSelectedPath] = useState(null);
|
const [selectedPath, setSelectedPath] = useState("");
|
||||||
const [downloadStarting, setDownloadStarting] = useState(false);
|
const [downloadStarting, setDownloadStarting] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -37,7 +37,7 @@ export function SelectFolderModal({
|
|||||||
|
|
||||||
const handleChooseDownloadsPath = async () => {
|
const handleChooseDownloadsPath = async () => {
|
||||||
const { filePaths } = await window.electron.showOpenDialog({
|
const { filePaths } = await window.electron.showOpenDialog({
|
||||||
defaultPath: selectedPath.downloadsPath,
|
defaultPath: selectedPath,
|
||||||
properties: ["openDirectory"],
|
properties: ["openDirectory"],
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ export function SelectFolderModal({
|
|||||||
|
|
||||||
const handleStartClick = () => {
|
const handleStartClick = () => {
|
||||||
setDownloadStarting(true);
|
setDownloadStarting(true);
|
||||||
startDownload(repack.id, selectedPath.downloadsPath).finally(() => {
|
startDownload(repack.id, selectedPath).finally(() => {
|
||||||
setDownloadStarting(false);
|
setDownloadStarting(false);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -65,7 +65,7 @@ export function SelectFolderModal({
|
|||||||
<div className={styles.downloadsPathField}>
|
<div className={styles.downloadsPathField}>
|
||||||
<TextField
|
<TextField
|
||||||
label={t("downloads_path")}
|
label={t("downloads_path")}
|
||||||
value={selectedPath.downloadsPath}
|
value={selectedPath}
|
||||||
readOnly
|
readOnly
|
||||||
disabled
|
disabled
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user