check version fallback

This commit is contained in:
smart_ex 2022-08-05 16:34:24 +10:00
parent 72f0e8399d
commit 9231f3f8ec

@ -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({