From 39ec8f434f6c866052fff4b642bddcd9fa26ea4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Fern=C3=A1ndez?= <44572727+abefernan@users.noreply.github.com> Date: Mon, 12 Jun 2023 16:15:28 +0200 Subject: [PATCH] Simplify remainingSignatures calc Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com> --- components/dataViews/ThresholdInfo.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/dataViews/ThresholdInfo.tsx b/components/dataViews/ThresholdInfo.tsx index 46d92b7..7623750 100644 --- a/components/dataViews/ThresholdInfo.tsx +++ b/components/dataViews/ThresholdInfo.tsx @@ -17,8 +17,7 @@ const ThresholdInfo = ({ signatures, pubkey }: Props) => { setUrlToCopy(urlWithoutQuery); }, []); - const signaturesDiff = Number(pubkey.value.threshold) - signatures.length; - const remainingSignatures = signaturesDiff > 0 ? signaturesDiff : 0; + const remainingSignatures = Math.max(Number(pubkey.value.threshold) - signatures.length, 0); if (!remainingSignatures) return null; return (