mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 21:44: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 [showRepacksModal, setShowRepacksModal] = useState(false);
|
||||
const [showSelectFolderModal, setShowSelectFolderModal] = useState(false);
|
||||
|
||||
const randomGameObjectID = useRef<string | null>(null);
|
||||
|
||||
@ -153,6 +154,7 @@ export function GameDetails() {
|
||||
).then(() => {
|
||||
getGame();
|
||||
setShowRepacksModal(false);
|
||||
setShowSelectFolderModal(false);
|
||||
});
|
||||
};
|
||||
|
||||
@ -177,6 +179,8 @@ export function GameDetails() {
|
||||
visible={showRepacksModal}
|
||||
gameDetails={gameDetails}
|
||||
startDownload={handleStartDownload}
|
||||
showSelectFolderModal={showSelectFolderModal}
|
||||
setShowSelectFolderModal={setShowSelectFolderModal}
|
||||
onClose={() => setShowRepacksModal(false)}
|
||||
/>
|
||||
)}
|
||||
|
@ -16,6 +16,8 @@ import { SelectFolderModal } from "./select-folder-modal";
|
||||
export interface RepacksModalProps {
|
||||
visible: boolean;
|
||||
gameDetails: ShopDetails;
|
||||
showSelectFolderModal: boolean;
|
||||
setShowSelectFolderModal: (value: boolean) => void;
|
||||
startDownload: (repackId: number, downloadPath: string) => Promise<void>;
|
||||
onClose: () => void;
|
||||
}
|
||||
@ -23,10 +25,11 @@ export interface RepacksModalProps {
|
||||
export function RepacksModal({
|
||||
visible,
|
||||
gameDetails,
|
||||
showSelectFolderModal,
|
||||
setShowSelectFolderModal,
|
||||
startDownload,
|
||||
onClose,
|
||||
}: RepacksModalProps) {
|
||||
const [openSelectFolderModal, setOpenSelectFolderModal] = useState(false);
|
||||
const [diskFreeSpace, setDiskFreeSpace] = useState<DiskSpace>(null);
|
||||
const [filteredRepacks, setFilteredRepacks] = useState<GameRepack[]>([]);
|
||||
const [repack, setRepack] = useState<GameRepack>(null);
|
||||
@ -53,7 +56,7 @@ export function RepacksModal({
|
||||
|
||||
const handleRepackClick = (repack: GameRepack) => {
|
||||
setRepack(repack);
|
||||
setOpenSelectFolderModal(true);
|
||||
setShowSelectFolderModal(true);
|
||||
};
|
||||
|
||||
const handleFilter: React.ChangeEventHandler<HTMLInputElement> = (event) => {
|
||||
@ -76,8 +79,8 @@ export function RepacksModal({
|
||||
onClose={onClose}
|
||||
>
|
||||
<SelectFolderModal
|
||||
visible={openSelectFolderModal}
|
||||
onClose={() => setOpenSelectFolderModal(false)}
|
||||
visible={showSelectFolderModal}
|
||||
onClose={() => setShowSelectFolderModal(false)}
|
||||
gameDetails={gameDetails}
|
||||
startDownload={startDownload}
|
||||
repack={repack}
|
||||
|
Loading…
Reference in New Issue
Block a user