Skip to content

Commit

Permalink
[MI-1465]: revert progress bar calcs to do received / total
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiabeluli committed May 9, 2024
1 parent a3044f5 commit 6c5dcac
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/app/widgets/JobStatus/components/ProgressArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { convertMillisecondsToTimeStamp, convertSecondsToTimeStamp } from '../..
*/
const ProgressArea = ({ state }) => {
const { senderStatus } = state;
const { total, received, elapsedTime, remainingTime, estimatedTime, startTime, isRotaryFile, ovF } = senderStatus;
const { total, received, elapsedTime, remainingTime, startTime, isRotaryFile } = senderStatus;

/**
* Format given time value to display minutes and seconds
Expand Down Expand Up @@ -95,13 +95,7 @@ const ProgressArea = ({ state }) => {
return getFinishTime(remainingTime);
};

let percentageValue;
if (isRotaryFile) {
percentageValue = Number.isNaN(received / total * 100) ? 0 : (received / total * 100).toFixed(0);
} else {
const adjustedEstimate = estimatedTime / (ovF / 100);
percentageValue = Number.isNaN(((adjustedEstimate - remainingTime) / adjustedEstimate) * 100) ? 0 : (((adjustedEstimate - remainingTime) / adjustedEstimate) * 100).toFixed(0);
}
const percentageValue = Number.isNaN(received / total * 100) ? 0 : (received / total * 100).toFixed(0);

return (
<div style={{ width: '50%', marginRight: '1rem' }}>
Expand Down

0 comments on commit 6c5dcac

Please sign in to comment.