Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Migrate to monorepo with 2.1.6 release #819

Merged
merged 5 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "alephium-wallet",
"description": "The official Alephium wallet",
"version": "2.1.5",
"version": "2.1.6",
"homepage": "./",
"author": "Alephium dev <dev@alephium.org>",
"main": "public/electron.js",
Expand Down
6 changes: 5 additions & 1 deletion public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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.
Expand Down Expand Up @@ -177,7 +181,7 @@ function createWindow() {

mainWindow.loadURL(appURL)

if (isDev) {
if (isDev || IS_RC) {
// Open the DevTools.
mainWindow?.webContents.openDevTools()
}
Expand Down
11 changes: 5 additions & 6 deletions src/hooks/useLatestGitHubRelease.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)

Expand Down Expand Up @@ -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
Loading