From 9231f3f8ec008e3c062a5e159d4d1ce4e5225e04 Mon Sep 17 00:00:00 2001 From: smart_ex Date: Fri, 5 Aug 2022 16:34:24 +1000 Subject: [PATCH] check version fallback --- src/services/health.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/health.service.ts b/src/services/health.service.ts index ce3e71c..bb4a74e 100644 --- a/src/services/health.service.ts +++ b/src/services/health.service.ts @@ -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({