From 22c992b56f7923cc8fc38359bfae147e9c8016b6 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Sun, 10 Nov 2024 10:05:44 +0700 Subject: [PATCH] Fix durability validation --- .../StorageRequestSetup/StorageRequestReview.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/StorageRequestSetup/StorageRequestReview.tsx b/src/components/StorageRequestSetup/StorageRequestReview.tsx index 42b22ec..2c18314 100644 --- a/src/components/StorageRequestSetup/StorageRequestReview.tsx +++ b/src/components/StorageRequestSetup/StorageRequestReview.tsx @@ -69,10 +69,12 @@ export function StorageRequestReview({ const onUpdateDurability = (data: Partial) => { onStorageRequestChange(data); + const merge = { ...storageRequest, ...data }; + const index = findDurabilityIndex({ - nodes: storageRequest.nodes, - tolerance: storageRequest.tolerance, - proofProbability: storageRequest.proofProbability, + nodes: merge.nodes, + tolerance: merge.tolerance, + proofProbability: merge.proofProbability, }); setDurability(index + 1);