mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 13:56:16 +00:00
redirect to home page when removing custom game from library
This commit is contained in:
@@ -178,6 +178,7 @@ export default function GameDetails() {
|
||||
onClose={() => {
|
||||
setShowGameOptionsModal(false);
|
||||
}}
|
||||
onNavigateHome={() => navigate("/")}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
@@ -177,10 +177,9 @@ export function EditGameModal({
|
||||
setIsUpdating(true);
|
||||
|
||||
try {
|
||||
const updatedGame =
|
||||
isCustomGame(game)
|
||||
? await updateCustomGame(game)
|
||||
: await updateNonCustomGame(game as LibraryGame);
|
||||
const updatedGame = isCustomGame(game)
|
||||
? await updateCustomGame(game)
|
||||
: await updateNonCustomGame(game as LibraryGame);
|
||||
|
||||
showSuccessToast(t("edit_custom_game_modal_success"));
|
||||
onGameUpdated(updatedGame);
|
||||
|
||||
@@ -18,12 +18,14 @@ export interface GameOptionsModalProps {
|
||||
visible: boolean;
|
||||
game: LibraryGame;
|
||||
onClose: () => void;
|
||||
onNavigateHome?: () => void;
|
||||
}
|
||||
|
||||
export function GameOptionsModal({
|
||||
visible,
|
||||
game,
|
||||
onClose,
|
||||
onNavigateHome,
|
||||
}: Readonly<GameOptionsModalProps>) {
|
||||
const { t } = useTranslation("game_details");
|
||||
|
||||
@@ -90,6 +92,11 @@ export function GameOptionsModal({
|
||||
await removeGameFromLibrary(game.shop, game.objectId);
|
||||
updateGame();
|
||||
onClose();
|
||||
|
||||
// Redirect to home page if it's a custom game
|
||||
if (game.shop === "custom" && onNavigateHome) {
|
||||
onNavigateHome();
|
||||
}
|
||||
};
|
||||
|
||||
const handleChangeExecutableLocation = async () => {
|
||||
|
||||
Reference in New Issue
Block a user