update fft only if data available

This commit is contained in:
DJ2LS 2023-08-27 20:20:11 +02:00
parent 67774765f5
commit 37e38e9be9

View file

@ -2010,9 +2010,8 @@ ipcRenderer.on("action-update-tnc-state", (event, arg) => {
checkForNewMessageWait = -1; checkForNewMessageWait = -1;
} }
checkForNewMessageWait++; checkForNewMessageWait++;
// update FFT // update FFT only if data available
if (typeof arg.fft !== "undefined") { if (typeof arg.fft !== "undefined" && arg.fft !== "[]") {
// FIXME: WE need to fix this when disabled waterfall chart
try { try {
var array = JSON.parse("[" + arg.fft + "]"); var array = JSON.parse("[" + arg.fft + "]");
spectrum.addData(array[0]); spectrum.addData(array[0]);