mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-25 11:51:02 +00:00
24 lines
482 B
TypeScript
24 lines
482 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", removeGame);
|