mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-22 02:13:59 +00:00
feat: pause seeding before deleting game
This commit is contained in:
@@ -3,11 +3,16 @@ import { registerEvent } from "../register-event";
|
||||
import { DownloadManager } from "@main/services";
|
||||
import { dataSource } from "@main/data-source";
|
||||
import { Game } from "@main/entity";
|
||||
import { gameRepository } from "@main/repository";
|
||||
|
||||
const pauseGameSeed = async (
|
||||
_event: Electron.IpcMainInvokeEvent,
|
||||
gameId: number
|
||||
) => {
|
||||
const game = await gameRepository.findOneBy({ id: gameId });
|
||||
|
||||
if (game?.status !== "seeding") return;
|
||||
|
||||
await dataSource.transaction(async (transactionalEntityManager) => {
|
||||
await transactionalEntityManager
|
||||
.getRepository(Game)
|
||||
|
||||
Reference in New Issue
Block a user