mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-17 16:33:55 +00:00
26 lines
567 B
TypeScript
26 lines
567 B
TypeScript
import { gameRepository } from "@main/repository";
|
|
|
|
import { registerEvent } from "../register-event";
|
|
import { parseExecutablePath } from "../helpers/parse-executable-path";
|
|
|
|
const updateExecutablePath = async (
|
|
_event: Electron.IpcMainInvokeEvent,
|
|
id: number,
|
|
executablePath: string | null
|
|
) => {
|
|
const parsedPath = executablePath
|
|
? parseExecutablePath(executablePath)
|
|
: null;
|
|
|
|
return gameRepository.update(
|
|
{
|
|
id,
|
|
},
|
|
{
|
|
executablePath: parsedPath,
|
|
}
|
|
);
|
|
};
|
|
|
|
registerEvent("updateExecutablePath", updateExecutablePath);
|