From fdf4c27b293212d0dfc8e7f4c33e44df0b64d0cd Mon Sep 17 00:00:00 2001 From: vicky prasad Date: Fri, 22 Apr 2022 00:48:22 +0530 Subject: [PATCH] fixed bug for ratings --- src/App.js | 3 +++ src/common/Header.jsx | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index ed2729688..0ec442fa6 100644 --- a/src/App.js +++ b/src/App.js @@ -37,6 +37,9 @@ const App = () => { } getActiveTab(); }, [tabId]); + + + return ( {/*
*/} diff --git a/src/common/Header.jsx b/src/common/Header.jsx index c2455e900..a61469a20 100644 --- a/src/common/Header.jsx +++ b/src/common/Header.jsx @@ -38,7 +38,8 @@ const Header = ({ domain, dynamicURL }) => { for(let char of Object.keys(obj)){ totalReviews+=obj[char] } - let val = Math.round((obj.Genuine/totalReviews)*5) + let gen=obj.Genuine?obj.Genuine:0 + let val = Math.round((gen/totalReviews)*5) setTotalReviews(val) setDataObject(obj); // (6/16)*5