mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
19 lines
530 B
TypeScript
19 lines
530 B
TypeScript
import { registerEvent } from "../register-event";
|
|
|
|
import { DownloadManager } from "@main/services";
|
|
import { GameShop } from "@types";
|
|
import { downloadsSublevel, levelKeys } from "@main/level";
|
|
|
|
const cancelGameDownload = async (
|
|
_event: Electron.IpcMainInvokeEvent,
|
|
shop: GameShop,
|
|
objectId: string
|
|
) => {
|
|
const downloadKey = levelKeys.game(shop, objectId);
|
|
|
|
await DownloadManager.cancelDownload(downloadKey);
|
|
|
|
await downloadsSublevel.del(downloadKey);
|
|
};
|
|
|
|
registerEvent("cancelGameDownload", cancelGameDownload);
|