don't send aprs position if disabled in config

avoid race conditions on DOM load (aprs symbol display)
This commit is contained in:
Hansi, dl9rdz 2024-08-12 22:29:08 +00:00
parent 2dc09763b5
commit 8674098b65
2 changed files with 5 additions and 1 deletions

View File

@ -16,7 +16,8 @@ function loadaprs(baseurl,callback) {
document.head.appendChild(script);
}
loadaprs("http://rdzsonde.mooo.com/aprs", function() {
document.addEventListener('DOMContentLoaded', function() {
loadaprs("http://rdzsonde.mooo.com/aprs", function() {
var inputBox = document.querySelector('input[name="tcp.beaconsym"]');
if(inputBox) {
inputBox.addEventListener('input', showaprs);
@ -33,6 +34,7 @@ loadaprs("http://rdzsonde.mooo.com/aprs", function() {
showaprs();
inputBox.addEventListener('input', function() { showaprs(); });
}
});
});
function footer() {

View File

@ -135,6 +135,8 @@ String ConnAPRS::getStatus() {
void ConnAPRS::aprs_station_update() {
int chase = sonde.config.chase;
if (chase == SH_LOC_OFF) // do not send any location
return;
// automatically decided if CHASE or FIXED mode is used (for config AUTO)
if (chase == SH_LOC_AUTO) {
if (posInfo.chase) chase = SH_LOC_CHASE; else chase = SH_LOC_FIXED;