From 50d917a33ea4cfe4e07f2b4931f47d5d026e4241 Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 25 Jul 2023 03:45:42 -0700 Subject: [PATCH] Update relayer version checks --- store/relayer.js | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/store/relayer.js b/store/relayer.js index dfaaa52..e9a9020 100644 --- a/store/relayer.js +++ b/store/relayer.js @@ -245,23 +245,13 @@ export const actions = { const getIsUpdated = () => { const relayerVersion = response.data.version - if (relayerVersion === '5.0.0') { - return true - } + const { major, prerelease } = parseSemanticVersion(relayerVersion) - const requiredMajor = hasEnabledLightProxy ? '5' : '4' - const { major, patch, prerelease } = parseSemanticVersion(relayerVersion) + const minimalMajorVersion = 5 + const isMajorVersionUpdated = Number(major) >= minimalMajorVersion + if (prerelease && Number(major) === 5 && hasEnabledLightProxy) return false - const isUpdatedMajor = major === requiredMajor - - if (isUpdatedMajor && prerelease) { - const minimalBeta = 11 - const [betaVersion] = prerelease.split('.').slice(-1) - return Number(betaVersion) >= minimalBeta - } - - const minimalPatch = 4 - return isUpdatedMajor && Number(patch) >= minimalPatch + return isMajorVersionUpdated } if (!getIsUpdated()) {