mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-12 11:12:07 +00:00
fix: fixing sonar issues
This commit is contained in:
parent
71cb4cd240
commit
2aff983dec
4 changed files with 7 additions and 8 deletions
|
@ -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()),
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue