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 31f5984
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 percentRounded = Math.ceil(percent * 100) / 100;
const percentThreshold = 0.001;
const percentString = String(percent);

if (percent < percentThreshold) {
if (percentRounded < 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 31f5984

Please sign in to comment.