1
0
mirror of https://github.com/KubaPro010/fm-dx-webserver.git synced 2026-02-26 14:11:59 +01:00

Improve small tune step logic to fix bug

Remove variable for small tune step to fix double assignment error.
This commit is contained in:
Adam Wisher
2024-02-09 09:26:32 +00:00
committed by GitHub
parent d5fb93508a
commit 09822cc285

View File

@@ -329,12 +329,10 @@ function checkKey(e) {
socket.send("T" + (currentFreq.toFixed(1) * 1000));
break;
case 38:
let smallStep = (currentFreq > 30) ? 10 : 1;
socket.send("T" + (Math.round(currentFreq*1000) + smallStep));
socket.send("T" + (Math.round(currentFreq*1000) + ((currentFreq > 30) ? 10 : 1)));
break;
case 40:
let smallStep = (currentFreq > 30) ? 10 : 1;
socket.send("T" + (Math.round(currentFreq*1000) - smallStep));
socket.send("T" + (Math.round(currentFreq*1000) - ((currentFreq > 30) ? 10 : 1)));
break;
case 37:
tuneDown();