From 4d98cd9468b423149c0349613bc88ecbdea860f1 Mon Sep 17 00:00:00 2001 From: Thoronium <107363768+NotThorny@users.noreply.github.com> Date: Thu, 31 Oct 2024 02:11:46 -0600 Subject: [PATCH] Fix comparison --- src/utils/download.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/utils/download.ts b/src/utils/download.ts index d8160b8..ebd40ba 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -109,25 +109,35 @@ export default class DownloadHandler { downloadingJar() { // Kinda hacky but it works - return this.downloads.some((d) => d.path.includes('grasscutter.zip') && d.status != ('finished' || 'error')) + return this.downloads.some( + (d) => d.path.includes('grasscutter.zip') && !(d.status.includes('finished') || d.status.includes('error')) + ) } downloadingFullBuild() { // Kinda hacky but it works - return this.downloads.some((d) => d.path.includes('GrasscutterCulti') && d.status != ('finished' || 'error')) + return this.downloads.some( + (d) => d.path.includes('GrasscutterCulti') && !(d.status.includes('finished') || d.status.includes('error')) + ) } downloadingResources() { // Kinda hacky but it works - return this.downloads.some((d) => d.path.includes('resources') && d.status != ('finished' || 'error')) + return this.downloads.some( + (d) => d.path.includes('resources') && !(d.status.includes('finished') || d.status.includes('error')) + ) } downloadingRepo() { - return this.downloads.some((d) => d.path.includes('grasscutter_repo.zip') && d.status != ('finished' || 'error')) + return this.downloads.some( + (d) => d.path.includes('grasscutter_repo.zip') && !(d.status.includes('finished') || d.status.includes('error')) + ) } downloadingMigoto() { - return this.downloads.some((d) => d.path.includes('3dmigoto') && d.status != ('finished' || 'error')) + return this.downloads.some( + (d) => d.path.includes('3dmigoto') && !(d.status.includes('finished') || d.status.includes('error')) + ) } addDownload(url: string, path: string, onFinish?: () => void) {