Merge branch 'adif-bug-fix' into 'master'

Fixed lookup cache merge on log event

See merge request gridtracker.org/gridtracker!327

If this is changing anything in the UI or operational behavior, please prepare to update the wiki!
master v1.24.0907-1
T Loomis 2024-09-07 04:08:35 +00:00
commit dcd1970d1f
1 zmienionych plików z 18 dodań i 37 usunięć

Wyświetl plik

@ -1572,49 +1572,30 @@ function sendToLogger(ADIF)
record.COUNTRY = GT.dxccToADIFName[Number(record.DXCC)];
}
if (GT.appSettings.lookupMerge == true)
if (GT.appSettings.lookupMerge == true && record.CALL in GT.lookupCache)
{
var request = GT.Idb
.transaction(["lookups"], "readwrite")
.objectStore("lookups")
.get(record.CALL);
request.onsuccess = function (event)
var lookup = GT.lookupCache[record.CALL];
for (var key in lookup)
{
if (request.result)
if (key in GT.adifLookupMap)
{
var lookup = request.result;
for (var key in lookup)
{
if (key in GT.adifLookupMap)
{
record[GT.adifLookupMap[key]] = lookup[key];
}
}
if ("GRIDSQUARE" in record && "grid" in lookup)
{
if (record.GRIDSQUARE.substr(0, 4) == lookup.grid.substr(0, 4))
{
record.GRIDSQUARE = lookup.grid;
}
}
if (GT.appSettings.lookupMissingGrid && "grid" in lookup && (!("GRIDSQUARE" in record) || record.GRIDSQUARE.length == 0))
{
record.GRIDSQUARE = lookup.grid;
}
record[GT.adifLookupMap[key]] = lookup[key];
}
finishSendingReport(record, localMode);
};
request.onerror = function (event)
}
if ("GRIDSQUARE" in record && "grid" in lookup)
{
finishSendingReport(record, localMode);
};
}
else
{
finishSendingReport(record, localMode);
if (record.GRIDSQUARE.substr(0, 4) == lookup.grid.substr(0, 4))
{
record.GRIDSQUARE = lookup.grid;
}
}
if (GT.appSettings.lookupMissingGrid && "grid" in lookup && (!("GRIDSQUARE" in record) || record.GRIDSQUARE.length == 0))
{
record.GRIDSQUARE = lookup.grid;
}
}
finishSendingReport(record, localMode);
}
function finishSendingReport(record, localMode)