diff --git a/README.md b/README.md index 29670a3c2..a0f913f35 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +## ⚠️ Deprecation warning: This repository has been integrated into the [Alephium frontend monorepo](https://github.com/alephium/alephium-frontend/) and is no longer maintained. + # Alephium desktop wallet The official Alephium desktop wallet. diff --git a/package-lock.json b/package-lock.json index 89dcb47d9..949085583 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "alephium-wallet", - "version": "2.1.5", + "version": "2.1.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "alephium-wallet", - "version": "2.1.5", + "version": "2.1.6", "dependencies": { "electron-context-menu": "^3.1.2", "electron-is-dev": "^2.0.0", diff --git a/package.json b/package.json index d8d1e2625..083e2c47b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "alephium-wallet", "description": "The official Alephium wallet", - "version": "2.1.5", + "version": "2.1.6", "homepage": "./", "author": "Alephium dev ", "main": "public/electron.js", diff --git a/public/electron.js b/public/electron.js index 11317305b..550ae818c 100644 --- a/public/electron.js +++ b/public/electron.js @@ -23,6 +23,9 @@ const isDev = require('electron-is-dev') const contextMenu = require('electron-context-menu') const { autoUpdater } = require('electron-updater') +const CURRENT_VERSION = app.getVersion() +const IS_RC = CURRENT_VERSION.includes('-rc.') + // Handle deep linking for alephium:// const ALEPHIUM = 'alephium' @@ -41,6 +44,7 @@ if (process.defaultApp) { contextMenu() autoUpdater.autoDownload = false +autoUpdater.allowPrerelease = IS_RC // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. @@ -177,7 +181,7 @@ function createWindow() { mainWindow.loadURL(appURL) - if (isDev) { + if (isDev || IS_RC) { // Open the DevTools. mainWindow?.webContents.openDevTools() } diff --git a/src/hooks/useLatestGitHubRelease.ts b/src/hooks/useLatestGitHubRelease.ts index efd022da9..5bdf02bd7 100644 --- a/src/hooks/useLatestGitHubRelease.ts +++ b/src/hooks/useLatestGitHubRelease.ts @@ -28,8 +28,9 @@ import { links } from '@/utils/links' const _window = window as unknown as AlephiumWindow const electron = _window.electron -const currentVersion = import.meta.env.VITE_VERSION -const semverRegex = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)?$/ +const currentVersion: string = import.meta.env.VITE_VERSION +const isRc = currentVersion.includes('-rc.') +const semverRegex = isRc ? /^(\d+\.\d+\.\d+)(?:-rc(\.\d+)?)?$/ : /^(\d+\.\d+\.\d+)?$/ const ONE_HOUR = 1000 * 60 * 60 @@ -53,9 +54,7 @@ const useLatestGitHubRelease = () => { useTimeout(async () => { const appData: AppMetaData = JSON.parse(localStorage.getItem(KEY_APPMETADATA) ?? '{}', toAppMetaData) ?? {} - const { lastVersionCheckedAt } = appData - // Uncomment to test updater every time the app launches - // const lastVersionCheckedAt = new Date(0) + const { lastVersionCheckedAt } = isRc ? { lastVersionCheckedAt: new Date(0) } : appData const timeSinceLastCheck = (lastVersionCheckedAt !== undefined && Date.now() - lastVersionCheckedAt.getTime()) || 0 const nextTimeUntilNextFetch = Math.max(0, ONE_HOUR - timeSinceLastCheck) @@ -87,4 +86,4 @@ const useLatestGitHubRelease = () => { export default useLatestGitHubRelease const isVersionNewer = (version: string): boolean => - semverRegex.test(version) && currentVersion && compareVersions(version, currentVersion) > 0 + semverRegex.test(version) && !!currentVersion && compareVersions(version, currentVersion) > 0