check version fallback

This commit is contained in:
smart_ex 2022-08-05 16:34:24 +10:00
parent 72f0e8399d
commit 9231f3f8ec
1 changed files with 3 additions and 3 deletions

View File

@ -124,9 +124,9 @@ export class HealthService {
async checkUpdate() {
console.log('Checking version...');
const lastVersion = (
await fetch('https://api.github.com/repos/tornadocash/tornado-relayer/releases').then((res) => res.json())
)[0]?.tag_name;
const lastVersion =
(await fetch('https://api.github.com/repos/tornadocash/tornado-relayer/releases').then((res) => res.json()))[0]?.tag_name ||
this.config.version;
const isUpToDate = compareVersions(this.config.version, lastVersion) === 0;
if (!isUpToDate) {
await this.pushAlert({