From bd5f9bc391ea41db6a6019369aa2a18ccf7d904d Mon Sep 17 00:00:00 2001
From: Dima Rifai <dima.rifai@gmail.com>
Date: Mon, 27 Jan 2025 16:13:35 +0200
Subject: [PATCH] Issue #399 - Fix string issue by sending zero to vest
 function if there are no vests

---
 hooks/api/common/useWitnessDetails.ts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hooks/api/common/useWitnessDetails.ts b/hooks/api/common/useWitnessDetails.ts
index 5c04f1d5..d033bcea 100644
--- a/hooks/api/common/useWitnessDetails.ts
+++ b/hooks/api/common/useWitnessDetails.ts
@@ -13,11 +13,11 @@ const useWitnessDetails = (accountName: string, isWitness: boolean) => {
     const witness = {
       ...witnessData,
       votes_updated_at: witnessData.votes_updated_at,
-      vests: hiveChain?.vests(witnessData.witness.vests),
+      vests: witnessData.witness.vests? hiveChain?.vests(witnessData.witness.vests):hiveChain?.vests(0) ,
       hbd_interest_rate: formatPercent(witnessData.witness.hbd_interest_rate),
-      votes_daily_change: hiveChain?.vests(
+      votes_daily_change:witnessData.witness.votes_daily_change ? hiveChain?.vests(
         witnessData.witness.votes_daily_change
-      ),
+      ):hiveChain?.vests(0) ,
     };
     const formattedWitness = hiveChain?.formatter.format(
       witness
-- 
GitLab