From e18b63a72e0e89dea034ac84a79be7d259a1c93f Mon Sep 17 00:00:00 2001 From: Peter Prince Date: Tue, 28 Mar 2023 10:27:41 +0100 Subject: [PATCH] Fix bug where old config files had bandpass filter added when loading --- saveLoad.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/saveLoad.js b/saveLoad.js index c53468d..8e27d8b 100644 --- a/saveLoad.js +++ b/saveLoad.js @@ -535,7 +535,10 @@ function useLoadedConfiguration (err, currentConfig, data, callback) { const passFiltersEnabled = (typeof jsonObj.passFiltersEnabled === 'undefined') ? replacementValues.passFiltersEnabled : jsonObj.passFiltersEnabled; - const filterType = (typeof jsonObj.filterType === 'undefined') ? replacementValues.filterType : jsonObj.filterType; + let filterType = (typeof jsonObj.filterType === 'undefined') ? replacementValues.filterType : jsonObj.filterType; + + // With older versions of the config app, filter type didn't exist + filterType = !passFiltersEnabled ? 'none' : filterType; const lowerFilter = (typeof jsonObj.lowerFilter === 'undefined') ? replacementValues.lowerFilter : jsonObj.lowerFilter; const higherFilter = (typeof jsonObj.higherFilter === 'undefined') ? replacementValues.higherFilter : jsonObj.higherFilter;