mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
25 lines
495 B
TypeScript
25 lines
495 B
TypeScript
import { registerEvent } from "../register-event";
|
|
import { gameRepository } from "../../repository";
|
|
import { GameStatus } from "@shared";
|
|
|
|
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",
|
|
});
|