From 7bcb29e303b69325249a1b7509a955698fa47d6a Mon Sep 17 00:00:00 2001
From: Zheng You Hong <107991825+vincenthongzy@users.noreply.github.com>
Date: Tue, 3 Sep 2024 17:02:17 +0800
Subject: [PATCH] Fix NAN for promoted operator TVL when search results is
empty
---
src/avs/AVSDetailsOperatorsTab.jsx | 10 +++++++---
src/operators/OperatorList.jsx | 10 +++++++---
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/avs/AVSDetailsOperatorsTab.jsx b/src/avs/AVSDetailsOperatorsTab.jsx
index aa8944b0..8fb972d8 100644
--- a/src/avs/AVSDetailsOperatorsTab.jsx
+++ b/src/avs/AVSDetailsOperatorsTab.jsx
@@ -112,6 +112,7 @@ function AVSOperatorsList({ address, avsError, isAVSLoading, tvl }) {
error: undefined,
operators: [],
promotedOperators: [],
+ promotedOperatorsRate: 1,
isInputTouched: false,
isTableLoading: true,
totalPages: undefined,
@@ -217,7 +218,8 @@ function AVSOperatorsList({ address, avsError, isAVSLoading, tvl }) {
try {
const response = await rdService.getAVSPromotedOperators(address);
dispatch({
- promotedOperators: response.results
+ promotedOperators: response.results,
+ promotedOperatorsRate: response.rate
});
} catch (e) {
//TODO: handle error
@@ -280,14 +282,16 @@ function AVSOperatorsList({ address, avsError, isAVSLoading, tvl }) {
: `${((operator.strategiesTotal / tvl) * 100).toFixed(2)}%`}