diff --git a/src/main/events/library/open-game-installer.ts b/src/main/events/library/open-game-installer.ts index 955d71fd2..ed4734816 100644 --- a/src/main/events/library/open-game-installer.ts +++ b/src/main/events/library/open-game-installer.ts @@ -30,7 +30,7 @@ const openGameInstaller = async ( const downloadKey = levelKeys.game(shop, objectId); const download = await downloadsSublevel.get(downloadKey); - if (!download || !download.folderName) return true; + if (!download?.folderName) return true; const gamePath = path.join( download.downloadPath ?? (await getDownloadsPath()), diff --git a/src/main/services/download/download-manager.ts b/src/main/services/download/download-manager.ts index 43073ede0..5b94f2463 100644 --- a/src/main/services/download/download-manager.ts +++ b/src/main/services/download/download-manager.ts @@ -29,8 +29,8 @@ export class DownloadManager { : undefined, downloadsToSeed?.map((download) => ({ game_id: `${download.shop}-${download.objectId}`, - url: download.uri!, - save_path: download.downloadPath!, + url: download.uri, + save_path: download.downloadPath, })) ); @@ -187,7 +187,7 @@ export class DownloadManager { if (!download) return; const totalSize = await getDirSize( - path.join(download.downloadPath!, status.folderName) + path.join(download.downloadPath, status.folderName) ); if (totalSize < status.fileSize) { @@ -223,7 +223,7 @@ export class DownloadManager { return this.startDownload(download); } - static async cancelDownload(downloadKey = this.downloadingGameId!) { + static async cancelDownload(downloadKey = this.downloadingGameId) { await PythonRPC.rpc.post("/action", { action: "cancel", game_id: downloadKey, diff --git a/src/main/services/notifications/index.ts b/src/main/services/notifications/index.ts index c0098ddd9..c9be2f541 100644 --- a/src/main/services/notifications/index.ts +++ b/src/main/services/notifications/index.ts @@ -10,8 +10,7 @@ import icon from "@resources/icon.png?asset"; import { NotificationOptions, toXmlString } from "./xml"; import { logger } from "../logger"; import type { Game, UserPreferences } from "@types"; -import { levelKeys } from "@main/level"; -import { db } from "@main/level"; +import { db, levelKeys } from "@main/level"; async function downloadImage(url: string | null) { if (!url) return undefined; diff --git a/src/renderer/src/pages/game-details/modals/repacks-modal.tsx b/src/renderer/src/pages/game-details/modals/repacks-modal.tsx index 4458edf62..b2b7b6f8f 100644 --- a/src/renderer/src/pages/game-details/modals/repacks-modal.tsx +++ b/src/renderer/src/pages/game-details/modals/repacks-modal.tsx @@ -67,7 +67,7 @@ export function RepacksModal({ }; const checkIfLastDownloadedOption = (repack: GameRepack) => { - if (!game || !game.download) return false; + if (!game?.download) return false; return repack.uris.some((uri) => uri.includes(game.download!.uri)); };