Skip to content

Commit fecb4ef

Browse files
committed
Fix: front-end errors
1 parent aca91da commit fecb4ef

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Protest/Front/ipbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class IpBox {
6565

6666
if (event.target.selectionStart === 0 && event.target.selectionEnd === 4) {
6767
let v = parseInt(event.target.value);
68-
if (v === NaN) v = 0;
68+
if (isNaN(v)) v = 0;
6969
if (v > 255) event.target.value = 255;
7070
if (!isNaN(event.key)) this.FocusNext(event.target);
7171
}

Protest/Front/monitor.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,6 +1763,13 @@ class Monitor extends Window {
17631763

17641764
if (options.isComplement) { value = max - value; }
17651765

1766+
if (last === null) {
1767+
last = value;
1768+
return;
1769+
}
1770+
1771+
let delta = value - last;
1772+
17661773
if (valley > delta) { valley = delta; }
17671774
if (peak < delta) { peak = delta; }
17681775

@@ -1771,13 +1778,6 @@ class Monitor extends Window {
17711778
max = peak * 1.05;
17721779
}
17731780

1774-
if (last === null) {
1775-
last = value;
1776-
return;
1777-
}
1778-
1779-
let delta = value - last;
1780-
17811781
if (list.length * gap > canvas.width) list.shift();
17821782
list.push(delta);
17831783

0 commit comments

Comments
 (0)