Skip to content

Commit

Permalink
fix: issue with mainnet update available
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Jan 9, 2021
1 parent a1f22b8 commit 94fa75a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Audit

on: [push]
on:
push:
branches:
- '**'

jobs:
audit:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/debug-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
uses: actions/checkout@v1

- uses: actions/cache@v2
id: cache-node-modules
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand Down Expand Up @@ -81,13 +82,15 @@ jobs:
# using separate run to install those packages separately
- name: Install packages
uses: nick-invision/retry@v2
if: steps.cache-node-modules.outputs.cache-hit != 'true'
with:
timeout_seconds: 600
max_attempts: 3
retry_on: error
command: yarn --frozen-lockfile --ignore-scripts

- name: Install `app/` packages
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: cd app && yarn --frozen-lockfile --ignore-scripts

- name: Extract version
Expand All @@ -111,7 +114,7 @@ jobs:
- run: ls -R release

- uses: actions/upload-artifact@v2
name: ${{ matrix.os }} upload
name: ${{ matrix.NPM_COMMAND }} ${{ matrix.stx_network }} upload
with:
name: stacks-wallet-${{ matrix.stx_network }}-${{ matrix.NPM_COMMAND }}
path: ${{ matrix.UPLOAD_ASSETS }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/exact-versions.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Exact versions

on: [push]

on:
push:
branches:
- '**'
jobs:
check-versions:
runs-on: ubuntu-latest
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Typecheck

on: [push]

on:
push:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-20.04
Expand Down
8 changes: 7 additions & 1 deletion app/hooks/use-check-for-updates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { WALLET_VERSION, NETWORK } from '@constants/index';
import { useInterval } from './use-interval';

const UPDATE_CHECK_INTERVAL = 120_000;
const NEW_WALLET_STARTING_MAJOR_VERSION = 4;

export function useCheckForUpdates() {
const [newerReleaseAvailable, setNewerReleaseAvailable] = useState(false);
Expand All @@ -20,7 +21,12 @@ export function useCheckForUpdates() {
// Prevent runtime errors incase an invalid tag makes it into upstream
.filter(release => compareVersions.validate(release.tag_name))
.filter(release => (NETWORK === 'mainnet' ? !release.prerelease : release.prerelease))
.filter(release => !release.tag_name.startsWith('v3'));
.filter(release => release.tag_name.startsWith('v'))
.filter(
release =>
typeof release.tag_name[1] === 'number' &&
release.tag_name[1] >= NEW_WALLET_STARTING_MAJOR_VERSION
);

if (latestReleases[0]) setLatestRelease(latestReleases[0]);

Expand Down

0 comments on commit 94fa75a

Please sign in to comment.