From e441edc56be0328dbf2d2fe07ea1b7ed8761c50f Mon Sep 17 00:00:00 2001 From: katspaugh <381895+katspaugh@users.noreply.github.com> Date: Mon, 23 Dec 2024 14:37:06 +0300 Subject: [PATCH] Fix: do not show queue warning for 1.3.0+ upgrades --- .../tx/confirmation-views/UpdateSafe/index.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/web/src/components/tx/confirmation-views/UpdateSafe/index.tsx b/apps/web/src/components/tx/confirmation-views/UpdateSafe/index.tsx index 6dec5f3949..9a8af7605a 100644 --- a/apps/web/src/components/tx/confirmation-views/UpdateSafe/index.tsx +++ b/apps/web/src/components/tx/confirmation-views/UpdateSafe/index.tsx @@ -1,5 +1,6 @@ import type { ReactNode } from 'react' import { Alert, AlertTitle, Box, Divider, Stack, Typography } from '@mui/material' +import semverSatisfies from 'semver/functions/satisfies' import { LATEST_SAFE_VERSION } from '@/config/constants' import { useCurrentChain } from '@/hooks/useChains' import useSafeInfo from '@/hooks/useSafeInfo' @@ -7,6 +8,8 @@ import { useQueuedTxsLength } from '@/hooks/useTxQueue' import ExternalLink from '@/components/common/ExternalLink' import { maybePlural } from '@/utils/formatters' +const QUEUE_WARNING_VERSION = '<1.3.0' + function BgBox({ children, light }: { children: ReactNode; light?: boolean }) { return ( - Current version: {safe.version} + Current version: {safeVersion} New version: {latestSafeVersion} - + Read about the updates in the new Safe contracts version in the{' '} version {latestSafeVersion} changelog - {queueSize && ( + {showQueueWarning && ( This upgrade will invalidate all queued transactions! You have {queueSize} unexecuted transaction{maybePlural(parseInt(queueSize))}. Please make sure to execute or @@ -52,7 +57,7 @@ function UpdateSafe() { )} - + ) }