mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-22 18:33:56 +00:00
26 lines
503 B
TypeScript
26 lines
503 B
TypeScript
import { registerEvent } from "../register-event";
|
|
import { gameRepository } from "../../repository";
|
|
import { GameStatus } from "@main/constants";
|
|
|
|
const removeGame = async (
|
|
_event: Electron.IpcMainInvokeEvent,
|
|
gameId: number
|
|
) => {
|
|
await gameRepository.update(
|
|
{
|
|
id: gameId,
|
|
status: GameStatus.Cancelled,
|
|
},
|
|
{
|
|
status: null,
|
|
downloadPath: null,
|
|
bytesDownloaded: 0,
|
|
progress: 0,
|
|
}
|
|
);
|
|
};
|
|
|
|
registerEvent(removeGame, {
|
|
name: "removeGame",
|
|
});
|