From a7e2aae2920d0d0e49e61e0ebf54c9c78fa721cf Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Tue, 27 Apr 2021 23:13:44 +0200 Subject: [PATCH] reset initial demodulator params on reconnects --- htdocs/lib/DemodulatorPanel.js | 4 ++++ htdocs/openwebrx.js | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/lib/DemodulatorPanel.js b/htdocs/lib/DemodulatorPanel.js index 3b815c2..8c10ff3 100644 --- a/htdocs/lib/DemodulatorPanel.js +++ b/htdocs/lib/DemodulatorPanel.js @@ -213,6 +213,10 @@ DemodulatorPanel.prototype.setInitialParams = function(params) { $.extend(this.initialParams, params); }; +DemodulatorPanel.prototype.resetInitialParams = function() { + this.initialParams = {}; +}; + DemodulatorPanel.prototype.onHashChange = function() { this._apply(this.transformHashParams(this.parseHash())); }; diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index 92cf973..3644fc4 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -1006,7 +1006,9 @@ function onAudioStart(apiType){ var reconnect_timeout = false; function on_ws_closed() { - $("#openwebrx-panel-receiver").demodulatorPanel().stopDemodulator(); + var demodulatorPanel = $("#openwebrx-panel-receiver").demodulatorPanel(); + demodulatorPanel.stopDemodulator(); + demodulatorPanel.resetInitialParams(); if (reconnect_timeout) { // max value: roundabout 8 and a half minutes reconnect_timeout = Math.min(reconnect_timeout * 2, 512000);