From f9f29e33ef8b60717896955319eaec04b3317bcf Mon Sep 17 00:00:00 2001 From: christian Date: Sat, 8 May 2021 22:57:52 -0400 Subject: [PATCH 1/2] reset default behavior for oams to pop up on new release --- package.nw/lib/defaults.js | 2 +- package.nw/lib/gt.js | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/package.nw/lib/defaults.js b/package.nw/lib/defaults.js index 1897dc6a..58077ae6 100644 --- a/package.nw/lib/defaults.js +++ b/package.nw/lib/defaults.js @@ -183,7 +183,7 @@ var def_msgSettings = { msgAlertWord: "New chat message", msgAlertMedia: "none", msgFrequencySelect: 0, - msgActionSelect: 0, + msgActionSelect: 1, msgAwaySelect: 0, msgAwayText: "I am away from the shack at the moment" }; diff --git a/package.nw/lib/gt.js b/package.nw/lib/gt.js index 53be5b68..8d084f73 100644 --- a/package.nw/lib/gt.js +++ b/package.nw/lib/gt.js @@ -115,6 +115,13 @@ function loadAllSettings() def_adifLogSettings ); g_msgSettings = loadDefaultsAndMerge("msgSettings", def_msgSettings); + // one-time override of oams pop-up messages: if pop-ups disabled + // and new version, reset msgActionSelect to 1 (pop up) + if (g_msgSettings.msgActionSelect == 0 && + String(gtVersion) != String(g_startVersion)) + { + g_msgSettings.msgActionSelect = 1; + } g_receptionSettings = loadDefaultsAndMerge( "receptionSettings", def_receptionSettings @@ -16038,7 +16045,8 @@ function pskSpotResults(buffer, flag) var call = json.receptionReport[key].receiverCallsign; var mode = json.receptionReport[key].mode; var grid = json.receptionReport[key].receiverLocator.substr(0, 6); - if (grid.length < 4) { + if (grid.length < 4) + { continue; } var band = Number( @@ -16157,7 +16165,8 @@ function createSpot(report, key, fromPoint, addToLayer = true) { var LL = squareToLatLongAll(report.grid); - if (isNaN(LL.la1)) { + if (isNaN(LL.la1)) + { // Bad value in grid, don't map // return; } From bc8ca271658dfd65cbcea50cf58a5cabc93ca40b Mon Sep 17 00:00:00 2001 From: christian Date: Sun, 9 May 2021 14:37:03 -0400 Subject: [PATCH 2/2] store settings as well --- package.nw/lib/gt.js | 1 + 1 file changed, 1 insertion(+) diff --git a/package.nw/lib/gt.js b/package.nw/lib/gt.js index 8d084f73..f9b75ccf 100644 --- a/package.nw/lib/gt.js +++ b/package.nw/lib/gt.js @@ -121,6 +121,7 @@ function loadAllSettings() String(gtVersion) != String(g_startVersion)) { g_msgSettings.msgActionSelect = 1; + localStorage.msgSettings = JSON.stringify(g_msgSettings); } g_receptionSettings = loadDefaultsAndMerge( "receptionSettings",