mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-23 10:51:02 +00:00
17 lines
395 B
TypeScript
17 lines
395 B
TypeScript
import { gameRepository } from "@main/repository";
|
|
|
|
import { registerEvent } from "../register-event";
|
|
import { shell } from "electron";
|
|
|
|
const openGame = async (
|
|
_event: Electron.IpcMainInvokeEvent,
|
|
gameId: number,
|
|
executablePath: string
|
|
) => {
|
|
await gameRepository.update({ id: gameId }, { executablePath });
|
|
|
|
shell.openPath(executablePath);
|
|
};
|
|
|
|
registerEvent("openGame", openGame);
|