From aeadba1524bf31ed04b9a44b6de57a32cfdec0c3 Mon Sep 17 00:00:00 2001 From: Guillermo Puente Date: Mon, 12 Aug 2024 11:16:37 -0400 Subject: [PATCH] feat: fix fix-urlBranchMap --- src/hooks/useLoadInitialData.tsx | 1 + src/hooks/utils.ts | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/hooks/useLoadInitialData.tsx b/src/hooks/useLoadInitialData.tsx index cb7a561b..320a4754 100644 --- a/src/hooks/useLoadInitialData.tsx +++ b/src/hooks/useLoadInitialData.tsx @@ -36,6 +36,7 @@ export const useLoadInitialData = () => { async function checkLatestVersion() { const result = await isLatestVersion(); + if (result === null) return; if (!result) { toast(, { type: 'connect-warning', diff --git a/src/hooks/utils.ts b/src/hooks/utils.ts index f203d1c1..cd8b99f1 100644 --- a/src/hooks/utils.ts +++ b/src/hooks/utils.ts @@ -4,9 +4,9 @@ export const isElectron = window.navigator.userAgent.includes('Electron'); export const isMac = window.navigator.appVersion.includes('Mac'); const urlBranchMap: Record = { - 'alpha/makerdao': 'deployments/staging/makerdao', - 'alpha/arbitrum': 'arb-ltip', - 'alpha/powerhouse': 'staging', + 'staging/makerdao': 'deployments/staging/makerdao', + 'staging/arbitrum': 'arb-ltip', + 'staging/powerhouse': 'staging', makerdao: 'deployments/makerdao', arbitrum: 'deployments/arbitrum', arbgrants: 'deployments/arbitrum', @@ -40,5 +40,10 @@ const fetchLatestVersion = async () => { export const isLatestVersion = async () => { const deployed = await fetchLatestVersion(); - return !deployed || deployed === currentVersion; + + if (deployed) { + return deployed === currentVersion; + } + + return null; };