From 1b379c1e26e8c2f353d28a53f3a7684e8e3a9840 Mon Sep 17 00:00:00 2001 From: Vitaliy Zarubin Date: Mon, 4 Nov 2024 17:27:53 +0300 Subject: [PATCH] [bug] Fix check install Aurora CLI. --- README.md | 2 +- data/ui/dialogs/AboutDialog.ui | 2 +- docs/install.md | 4 +- meson.build | 2 +- src/base/constants/AppConstants.js | 2 +- src/feature/pages/welcome/WelcomePage.js | 62 ++++++++++++------------ 6 files changed, 36 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 3dceb92..ddd483b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ### Subscribe and like! -[![Version](https://img.shields.io/badge/deb_package-0.0.10-blue)](https://github.com/keygenqt/aurora-toolbox/releases) +[![Version](https://img.shields.io/badge/deb_package-0.0.11-blue)](https://github.com/keygenqt/aurora-toolbox/releases) ![Preview](https://raw.githubusercontent.com/keygenqt/aurora-toolbox/refs/heads/main/files/images/preview_telegram.png) diff --git a/data/ui/dialogs/AboutDialog.ui b/data/ui/dialogs/AboutDialog.ui index 18d5485..d0e7742 100644 --- a/data/ui/dialogs/AboutDialog.ui +++ b/data/ui/dialogs/AboutDialog.ui @@ -4,7 +4,7 @@ floating com.keygenqt.aurora-toolbox Aurora Toolbox - 0.0.10 + 0.0.11 © 2024 KeyGenQt https://github.com/keygenqt/aurora-toolbox/issues Vitaliy Zarubin diff --git a/docs/install.md b/docs/install.md index cd6086d..7e9a817 100644 --- a/docs/install.md +++ b/docs/install.md @@ -14,14 +14,14 @@ hide: Установка на примере дистрибутива Ubuntu, но так же доступен rpm пакет, который можно установит примерно так: ```shell - sudo rpm -i aurora-toolbox_0.0.10-1_x86_64.rpm + sudo rpm -i aurora-toolbox_0.0.11-1_x86_64.rpm ``` #### Install ```shell -sudo dpkg -i aurora-toolbox_0.0.10-1_amd64.deb +sudo dpkg -i aurora-toolbox_0.0.11-1_amd64.deb ``` #### Update/Install dependency diff --git a/meson.build b/meson.build index 9d7549f..8cd57f7 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ # Define our project project( 'aurora-toolbox', - version: '0.0.10', + version: '0.0.11', license: ['Apache 2.0'], meson_version: '>= 0.59.0', default_options: ['cpp_std=c++17', 'cpp_rtti=false', 'cpp_eh=none', diff --git a/src/base/constants/AppConstants.js b/src/base/constants/AppConstants.js index ad5470f..f39cdc3 100644 --- a/src/base/constants/AppConstants.js +++ b/src/base/constants/AppConstants.js @@ -17,7 +17,7 @@ import GLib from 'gi://GLib'; export const AppConstants = Object.freeze({ App: { - version: '0.0.10', + version: '0.0.11', doc: 'https://keygenqt.github.io/aurora-toolbox/', docInstall: 'https://keygenqt.github.io/aurora-toolbox/install/', latestRelease: 'https://api.github.com/repos/keygenqt/aurora-toolbox/releases/latest', diff --git a/src/feature/pages/welcome/WelcomePage.js b/src/feature/pages/welcome/WelcomePage.js index 8872122..87b3a75 100644 --- a/src/feature/pages/welcome/WelcomePage.js +++ b/src/feature/pages/welcome/WelcomePage.js @@ -74,40 +74,38 @@ export const WelcomePage = GObject.registerClass({ this.#window.navigation().push(this.utils.constants.Pages.ToolsPage); return } - if (response && response.code === 200) { - // Failed to retrieve data - if (response.cliLatest === undefined) { - response.cliLatest = response.cliInstalled; - } - if (response.toolboxLatest === undefined) { - response.toolboxLatest = response.toolboxInstalled; - } - // Check new version - const hasNewVersionCLI = response.cliInstalled !== response.cliLatest; - const hasNewVersionToolbox = response.toolboxInstalled !== response.toolboxLatest; - // If has new version - if (hasNewVersionToolbox) { - this.#setStateUpdate(response.toolboxLatest, true); - this.#statePage(WelcomePageStates.UPDATE); - return - } - else if (hasNewVersionCLI) { - this.#setStateUpdate(response.cliLatest, false); - this.#statePage(WelcomePageStates.UPDATE); + // Failed to retrieve data + if (response.cliLatest === undefined && response.toolboxLatest === undefined) { + response.cliLatest = response.cliInstalled; + response.toolboxLatest = response.toolboxInstalled; + } + if (response.cliLatest === undefined) { + this.#statePage(WelcomePageStates.NOT_FOUND); + return; + } + // Check new version + const hasNewVersionCLI = response.cliInstalled !== response.cliLatest; + const hasNewVersionToolbox = response.toolboxInstalled !== response.toolboxLatest; + // If has new version + if (hasNewVersionToolbox) { + this.#setStateUpdate(response.toolboxLatest, true); + this.#statePage(WelcomePageStates.UPDATE); + return + } + else if (hasNewVersionCLI) { + this.#setStateUpdate(response.cliLatest, false); + this.#statePage(WelcomePageStates.UPDATE); + return + } + else { + // If first app open + if (settings.get_boolean('first-open')) { + this._IdConnect.version = `${response.cliInstalled}`; + this.#statePage(WelcomePageStates.CONNECT); return } - else { - // If first app open - if (settings.get_boolean('first-open')) { - this._IdConnect.version = `${response.cliInstalled}`; - this.#statePage(WelcomePageStates.CONNECT); - return - } - // Open tools - this.#window.navigation().push(this.utils.constants.Pages.ToolsPage); - } - } else { - this.#statePage(WelcomePageStates.NOT_FOUND); + // Open tools + this.#window.navigation().push(this.utils.constants.Pages.ToolsPage); } } catch(e) { this.#statePage(WelcomePageStates.NOT_FOUND);