diff --git a/src/app_service/service/about/service.nim b/src/app_service/service/about/service.nim index fff58222dc..90bc575b72 100644 --- a/src/app_service/service/about/service.nim +++ b/src/app_service/service/about/service.nim @@ -12,9 +12,6 @@ import ../../../constants logScope: topics = "about-service" -# This is changed during compilation by reading the VERSION file -const DESKTOP_VERSION {.strdefine.} = "0.0.0" - const APP_UPDATES_ENS* = "desktop.status.eth" type @@ -48,7 +45,7 @@ QtObject: result.threadpool = threadpool proc getAppVersion*(self: Service): string = - return DESKTOP_VERSION + return APP_VERSION proc getNodeVersion*(self: Service): string = try: @@ -58,7 +55,7 @@ QtObject: proc checkForUpdates*(self: Service) = try: - discard status_about.checkForUpdates(types.Mainnet, APP_UPDATES_ENS, DESKTOP_VERSION) + discard status_about.checkForUpdates(types.Mainnet, APP_UPDATES_ENS, self.getAppVersion()) except Exception as e: error "Error checking for updates", msg=e.msg diff --git a/src/constants.nim b/src/constants.nim index c5437567e7..52c6384e17 100644 --- a/src/constants.nim +++ b/src/constants.nim @@ -1,4 +1,4 @@ -import os, sequtils, strutils +import os, sequtils, strutils, strformat import # vendor libs confutils @@ -71,9 +71,11 @@ proc ensureDirectories*(dataDir, tmpDir, logDir: string) = createDir(logDir) # This is changed during compilation by reading the VERSION file -const DESKTOP_VERSION* {.strdefine.} = "0.0.0" +const DESKTOP_VERSION {.strdefine.} = "0.0.0" # This is changed during compilation by executing git command const GIT_COMMIT* {.strdefine.} = "" +const APP_VERSION* = if defined(production): DESKTOP_VERSION else: fmt("git master {GIT_COMMIT}") + # Name of the test environment var to check for -const TEST_ENVIRONMENT_VAR* = "TEST_ENVIRONMENT" \ No newline at end of file +const TEST_ENVIRONMENT_VAR* = "TEST_ENVIRONMENT" diff --git a/src/nim_status_client.nim b/src/nim_status_client.nim index 88711d20c9..42b5aea537 100644 --- a/src/nim_status_client.nim +++ b/src/nim_status_client.nim @@ -166,7 +166,7 @@ proc mainProc() = keycardServiceQObjPointer = cast[pointer](appController.keycardService.vptr) setupRemoteSignalsHandling() - info fmt("Version: {DESKTOP_VERSION}") + info fmt("Version: {APP_VERSION}") info fmt("Commit: {GIT_COMMIT}") info "Current date:", currentDateTime=now() diff --git a/ui/app/AppLayouts/Profile/ProfileLayout.qml b/ui/app/AppLayouts/Profile/ProfileLayout.qml index 85e42c388f..7e10479fba 100644 --- a/ui/app/AppLayouts/Profile/ProfileLayout.qml +++ b/ui/app/AppLayouts/Profile/ProfileLayout.qml @@ -264,6 +264,8 @@ StatusSectionLayout { contentWidth: d.contentWidth store: QtObject { + readonly property bool isProduction: production + function checkForUpdates() { return root.store.checkForUpdates() } @@ -273,7 +275,10 @@ StatusSectionLayout { } function getReleaseNotes() { - openLink("https://github.com/status-im/status-desktop/releases/%1".arg(getCurrentVersion())) + const link = isProduction ? "https://github.com/status-im/status-desktop/releases/%1".arg(getCurrentVersion()) : + "https://github.com/status-im/status-desktop/" + + openLink(link) } function openLink(url) { diff --git a/ui/app/AppLayouts/Profile/views/AboutView.qml b/ui/app/AppLayouts/Profile/views/AboutView.qml index d450452bc4..6494ffcce7 100644 --- a/ui/app/AppLayouts/Profile/views/AboutView.qml +++ b/ui/app/AppLayouts/Profile/views/AboutView.qml @@ -16,6 +16,7 @@ SettingsContentBase { property var store + titleRowComponentLoader.active: root.store.isProduction titleRowComponentLoader.sourceComponent: StatusButton { size: StatusBaseButton.Size.Small text: qsTr("Check for updates")