From 34b9a605d821b2484a6bd6f833e691eaa590e1fc Mon Sep 17 00:00:00 2001 From: SushyDev Date: Wed, 16 Dec 2020 16:58:54 +0100 Subject: [PATCH] Multiple small bug fixes, fixed updates being added to the installed games list --- app/js/components/downloader/download-manager.js | 16 +++++++++------- package.json | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/js/components/downloader/download-manager.js b/app/js/components/downloader/download-manager.js index 82e3f03..1a4282f 100644 --- a/app/js/components/downloader/download-manager.js +++ b/app/js/components/downloader/download-manager.js @@ -55,9 +55,9 @@ function startDownload(url, dir, gameTitle) { }; //Remove starting snackbar - console.log(gameTitle) - if(!gameTitle.includes('vapor-store-update')) closeSnackbar(`${gameTitle}-download-starting`, false); - + console.log(gameTitle); + if (!gameTitle.includes('vapor-store-update')) closeSnackbar(`${gameTitle}-download-starting`, false); + //Create snackbar createSnack(snackbarData); @@ -102,15 +102,18 @@ function startDownload(url, dir, gameTitle) { item.once('done', (event, state) => { //On download complete if (state === 'completed') { - //Remove downloaded game from array downloading.shift(); //Remove download snackbar closeSnackbar(`${name}-download`, false); - //Add downloaded game to library - addGameToLibrary(fullPath, localStorage.getItem('downloadDir'), fileName, gameTitle); + //Add downloaded game to library or install update + if (gameTitle == 'vapor-store-update') { + installUpdate(fileName); + } else { + addGameToLibrary(fullPath, localStorage.getItem('downloadDir'), fileName, gameTitle); + } var snackbarData = { ['main']: [ @@ -156,7 +159,6 @@ function startDownload(url, dir, gameTitle) { //Extract downloaded zip file if (fileType == 'zip') createSnack(snackbarData); - if (gameTitle == 'vapor-store-update') installUpdate(fileName) } else { //Download didnt complete console.log(`Download failed: ${state}`); diff --git a/package.json b/package.json index 8e05f98..50636c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vapor-store", - "version": "2.0.0-beta-19", + "version": "2.0.0-beta-20", "description": "Vapor Store", "author": "SushyDev", "main": "app.js", @@ -72,5 +72,5 @@ "electron": "^7.2.4", "electron-builder": "^22.9.1", "electron-reload": "^1.5.0" - } + } }