Skip to content

Commit b4a17be

Browse files
committed
Sonar nitpicks
1 parent ecdaec7 commit b4a17be

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/main.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,11 +1885,12 @@ function BlackboxLogViewer() {
18851885
const gi = Number.parseInt(graph, 10);
18861886
const fi = Number.parseInt(field, 10);
18871887
// restore single pen
1888-
if (graphConfig[gi].fields[fi].default != null) {
1889-
graphConfig[gi].fields[fi].smoothing = graphConfig[gi].fields[fi].default.smoothing;
1890-
graphConfig[gi].fields[fi].curve.power = graphConfig[gi].fields[fi].default.power;
1891-
return "<h4>Restored defaults for single pen</h4>";
1892-
} else return false;
1888+
if (graphConfig[gi].fields[fi].default == null) {
1889+
return false; // no defaults stored
1890+
}
1891+
graphConfig[gi].fields[fi].smoothing = graphConfig[gi].fields[fi].default.smoothing;
1892+
graphConfig[gi].fields[fi].curve.power = graphConfig[gi].fields[fi].default.power;
1893+
return "<h4>Restored defaults for single pen</h4>";
18931894
}
18941895
return false; // nothing was changed
18951896
}
@@ -2314,10 +2315,8 @@ function BlackboxLogViewer() {
23142315
} else {
23152316
bookmarkTimes[e.which - 48] = null; // clear the bookmark
23162317
}
2317-
$(`.bookmark-${e.which - 48}`, statusBar).css(
2318-
"visibility",
2319-
bookmarkTimes[e.which - 48] === null ? "hidden" : "visible"
2320-
);
2318+
$(`.bookmark-${e.which - 48}`, statusBar)
2319+
.css("visibility", bookmarkTimes[e.which - 48] === null ? "hidden" : "visible");
23212320
let countBookmarks = 0;
23222321
for (let i = 0; i <= 9; i++) {
23232322
countBookmarks += bookmarkTimes[i] === null ? 0 : 1;

0 commit comments

Comments
 (0)