Live query percent fix (#4768)

This commit is contained in:
RachelElysia 2022-03-23 14:50:16 -04:00 committed by GitHub
parent 345de5d8d4
commit cf34466e7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View file

@ -66,11 +66,11 @@ const QueryResults = ({
useEffect(() => {
const calculatePercent =
Math.round(
((totalRowsCount + errors?.length) / targetsTotalCount) * 100
) || 0;
targetsTotalCount !== 0
? Math.round((campaign.hosts_count.total / targetsTotalCount) * 100)
: 0;
setTargetsRespondedPercent(calculatePercent);
}, [totalRowsCount, errors]);
}, [campaign]);
useEffect(() => {
if (isQueryFinished) {

View file

@ -63,11 +63,11 @@ const QueryResults = ({
useEffect(() => {
const calculatePercent =
Math.round(
((totalRowsCount + errors?.length) / targetsTotalCount) * 100
) || 0;
targetsTotalCount !== 0
? Math.round((campaign.hosts_count.total / targetsTotalCount) * 100)
: 0;
setTargetsRespondedPercent(calculatePercent);
}, [totalRowsCount, errors]);
}, [campaign]);
useEffect(() => {
if (isQueryFinished) {