Skip to content

Commit

Permalink
accommodate SELECT MODE in sota
Browse files Browse the repository at this point in the history
SELECT MODE means that there will be limited further data, especially
mode and frequency, so take extra care in display formatting
  • Loading branch information
jeffkowalski committed Nov 1, 2024
1 parent 1f26cb9 commit 3386253
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/web/sota.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,16 @@ async function updateSotaTable()

const frequencyCell = row.insertCell();
const frequencyLink = document.createElement('a');
frequencyLink.href = `#`; // Placeholder
frequencyLink.textContent = spot.frequency.toFixed(3);
frequencyLink.onclick = function(event) {
event.preventDefault(); // Prevent default link behavior
tuneRadioMHz(spot.frequency, spot.mode);
if (spot.frequency && typeof spot.frequency === 'number') {
frequencyLink.textContent = spot.frequency.toFixed(3);
frequencyLink.onclick = function(event) {
event.preventDefault(); // Prevent default link behavior
tuneRadioMHz(spot.frequency, spot.mode);
}
}
else {
frequencyLink.textContent = "";
frequencyLink.href = `#`; // Placeholder
}
frequencyCell.appendChild(frequencyLink);

Expand Down

0 comments on commit 3386253

Please sign in to comment.