mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: show toast after create shortcut
This commit is contained in:
parent
8fad9b05e6
commit
37b9eca0e1
3 changed files with 16 additions and 4 deletions
|
|
@ -5,7 +5,7 @@ import type { Game } from "@types";
|
|||
import * as styles from "./game-options-modal.css";
|
||||
import { gameDetailsContext } from "@renderer/context";
|
||||
import { DeleteGameModal } from "@renderer/pages/downloads/delete-game-modal";
|
||||
import { useDownload } from "@renderer/hooks";
|
||||
import { useDownload, useToast } from "@renderer/hooks";
|
||||
import { RemoveGameFromLibraryModal } from "./remove-from-library-modal";
|
||||
|
||||
export interface GameOptionsModalProps {
|
||||
|
|
@ -21,6 +21,8 @@ export function GameOptionsModal({
|
|||
}: GameOptionsModalProps) {
|
||||
const { t } = useTranslation("game_details");
|
||||
|
||||
const { showSuccessToast, showErrorToast } = useToast();
|
||||
|
||||
const { updateGame, setShowRepacksModal, selectGameExecutable } =
|
||||
useContext(gameDetailsContext);
|
||||
|
||||
|
|
@ -61,7 +63,13 @@ export function GameOptionsModal({
|
|||
};
|
||||
|
||||
const handleCreateShortcut = async () => {
|
||||
await window.electron.createGameShortcut(game.id);
|
||||
window.electron.createGameShortcut(game.id).then((success) => {
|
||||
if (success) {
|
||||
showSuccessToast(t("create_shortcut_success"));
|
||||
} else {
|
||||
showErrorToast(t("create_shortcut_error"));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleOpenDownloadFolder = async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue