mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-13 03:32:13 +00:00
refactor removeGameFromLibrary to handle error
This commit is contained in:
parent
ab4cf23f97
commit
b07451e91d
1 changed files with 7 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
import { registerEvent } from "../register-event";
|
||||
import { gameRepository } from "../../repository";
|
||||
import { HydraApi } from "@main/services/hydra-api";
|
||||
import { logger } from "@main/services";
|
||||
|
||||
const removeGameFromLibrary = async (
|
||||
_event: Electron.IpcMainInvokeEvent,
|
||||
|
@ -11,6 +12,12 @@ const removeGameFromLibrary = async (
|
|||
{ isDeleted: true, executablePath: null }
|
||||
);
|
||||
|
||||
removeRemoveGameFromLibrary(gameId).catch((err) => {
|
||||
logger.error("removeRemoveGameFromLibrary", err);
|
||||
});
|
||||
};
|
||||
|
||||
const removeRemoveGameFromLibrary = async (gameId: number) => {
|
||||
const game = await gameRepository.findOne({ where: { id: gameId } });
|
||||
|
||||
if (game?.remoteId) {
|
||||
|
|
Loading…
Reference in a new issue