From 8e313517d1e5c0812845de2f57b10bc7af09374b Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 3 May 2020 21:26:11 +0200 Subject: [PATCH] initialize frequeny correctly --- htdocs/lib/DemodulatorPanel.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/lib/DemodulatorPanel.js b/htdocs/lib/DemodulatorPanel.js index 8a92f2a..bab7c02 100644 --- a/htdocs/lib/DemodulatorPanel.js +++ b/htdocs/lib/DemodulatorPanel.js @@ -113,11 +113,13 @@ DemodulatorPanel.prototype.setMode = function(modulation) { this.demodulator = new Demodulator(current.offset_frequency, modulation); this.demodulator.setSquelch(current.squelch_level); var self = this; - this.demodulator.on("frequencychange", function(freq) { + var updateFrequency = function(freq) { self.tuneableFrequencyDisplay.setFrequency(self.center_freq + freq); self.updateHash(); - }); - updateSquelch = function(squelch) { + }; + this.demodulator.on("frequencychange", updateFrequency); + updateFrequency(this.demodulator.get_offset_frequency()); + var updateSquelch = function(squelch) { self.el.find('.openwebrx-squelch-slider').val(squelch); self.updateHash(); };