Skip to content

Commit

Permalink
fix: apply edits
Browse files Browse the repository at this point in the history
  • Loading branch information
KuznetsovRoman committed Mar 4, 2024
1 parent 93b56af commit 4278c26
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/static/components/state/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,14 @@ class State extends Component {

_getDisplayedDiffPercentValue() {
const percent = this.props.image.diffRatio * 100;
const percentThreshold = 0.001;
const percentString = String(percent);
const percentRounded = Math.ceil(percent * 100) / 100;
const percentThreshold = 0.01;

if (percent < percentThreshold) {
return `< ${percentThreshold}`
}

if (percent > 1) {
return percentString.slice(0, 4);
}

return percentString.slice(0, 5);

return String(percentRounded);
}

_getStateTitleWithDiffCount() {
Expand Down

0 comments on commit 4278c26

Please sign in to comment.