mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-24 05:54:55 +03:00
fix: select Folder Modal doesn't close
This commit is contained in:
parent
bd2ad383c6
commit
2e53523076
@ -51,6 +51,7 @@ export function GameDetails() {
|
|||||||
const { t, i18n } = useTranslation("game_details");
|
const { t, i18n } = useTranslation("game_details");
|
||||||
|
|
||||||
const [showRepacksModal, setShowRepacksModal] = useState(false);
|
const [showRepacksModal, setShowRepacksModal] = useState(false);
|
||||||
|
const [showSelectFolderModal, setShowSelectFolderModal] = useState(false);
|
||||||
|
|
||||||
const randomGameObjectID = useRef<string | null>(null);
|
const randomGameObjectID = useRef<string | null>(null);
|
||||||
|
|
||||||
@ -153,6 +154,7 @@ export function GameDetails() {
|
|||||||
).then(() => {
|
).then(() => {
|
||||||
getGame();
|
getGame();
|
||||||
setShowRepacksModal(false);
|
setShowRepacksModal(false);
|
||||||
|
setShowSelectFolderModal(false);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -177,6 +179,8 @@ export function GameDetails() {
|
|||||||
visible={showRepacksModal}
|
visible={showRepacksModal}
|
||||||
gameDetails={gameDetails}
|
gameDetails={gameDetails}
|
||||||
startDownload={handleStartDownload}
|
startDownload={handleStartDownload}
|
||||||
|
showSelectFolderModal={showSelectFolderModal}
|
||||||
|
setShowSelectFolderModal={setShowSelectFolderModal}
|
||||||
onClose={() => setShowRepacksModal(false)}
|
onClose={() => setShowRepacksModal(false)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -16,6 +16,8 @@ import { SelectFolderModal } from "./select-folder-modal";
|
|||||||
export interface RepacksModalProps {
|
export interface RepacksModalProps {
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
gameDetails: ShopDetails;
|
gameDetails: ShopDetails;
|
||||||
|
showSelectFolderModal: boolean;
|
||||||
|
setShowSelectFolderModal: (value: boolean) => void;
|
||||||
startDownload: (repackId: number, downloadPath: string) => Promise<void>;
|
startDownload: (repackId: number, downloadPath: string) => Promise<void>;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
}
|
}
|
||||||
@ -23,10 +25,11 @@ export interface RepacksModalProps {
|
|||||||
export function RepacksModal({
|
export function RepacksModal({
|
||||||
visible,
|
visible,
|
||||||
gameDetails,
|
gameDetails,
|
||||||
|
showSelectFolderModal,
|
||||||
|
setShowSelectFolderModal,
|
||||||
startDownload,
|
startDownload,
|
||||||
onClose,
|
onClose,
|
||||||
}: RepacksModalProps) {
|
}: RepacksModalProps) {
|
||||||
const [openSelectFolderModal, setOpenSelectFolderModal] = useState(false);
|
|
||||||
const [diskFreeSpace, setDiskFreeSpace] = useState<DiskSpace>(null);
|
const [diskFreeSpace, setDiskFreeSpace] = useState<DiskSpace>(null);
|
||||||
const [filteredRepacks, setFilteredRepacks] = useState<GameRepack[]>([]);
|
const [filteredRepacks, setFilteredRepacks] = useState<GameRepack[]>([]);
|
||||||
const [repack, setRepack] = useState<GameRepack>(null);
|
const [repack, setRepack] = useState<GameRepack>(null);
|
||||||
@ -53,7 +56,7 @@ export function RepacksModal({
|
|||||||
|
|
||||||
const handleRepackClick = (repack: GameRepack) => {
|
const handleRepackClick = (repack: GameRepack) => {
|
||||||
setRepack(repack);
|
setRepack(repack);
|
||||||
setOpenSelectFolderModal(true);
|
setShowSelectFolderModal(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleFilter: React.ChangeEventHandler<HTMLInputElement> = (event) => {
|
const handleFilter: React.ChangeEventHandler<HTMLInputElement> = (event) => {
|
||||||
@ -76,8 +79,8 @@ export function RepacksModal({
|
|||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
>
|
>
|
||||||
<SelectFolderModal
|
<SelectFolderModal
|
||||||
visible={openSelectFolderModal}
|
visible={showSelectFolderModal}
|
||||||
onClose={() => setOpenSelectFolderModal(false)}
|
onClose={() => setShowSelectFolderModal(false)}
|
||||||
gameDetails={gameDetails}
|
gameDetails={gameDetails}
|
||||||
startDownload={startDownload}
|
startDownload={startDownload}
|
||||||
repack={repack}
|
repack={repack}
|
||||||
|
Loading…
Reference in New Issue
Block a user