From 892dfbf97f46576d41f1ac27cd51240d1d3036c1 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Tue, 3 Feb 2026 21:14:31 +0100 Subject: [PATCH] by the way fixing the last dxspot feature and make the UX more logic (was killing the qso form if the button was hit accidentially --- application/views/qso/index.php | 3 +++ assets/js/sections/qso.js | 25 ++++++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 39901846e..8fa1f481a 100644 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -42,6 +42,9 @@ switch ($date_format) { var lang_qso_sat_lotw_support_not_found = ""; var lang_qso_sat_lotw_supported = ""; var lang_qso_sat_lotw_not_supported = ""; + var lang_general_word_info = ""; + var lang_qso_you_already_filled_an_qso = ""; + var lang_qso_no_spots_found = ""; diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index a5d01c033..e4ddc4b2b 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -281,13 +281,24 @@ $('#locator').on('input', function () { }); $("#check_cluster").on("click", function () { - $.ajax({ url: dxcluster_provider + "/qrg_lookup/" + $("#frequency").val() / 1000, cache: false, dataType: "json" }).done( - function (dxspot) { - reset_fields(); - $("#callsign").val(dxspot.spotted); - $("#callsign").trigger("blur"); - } - ); + if ($("#callsign").val().trim() == '') { + $.ajax({ + url: dxcluster_provider + "/qrg_lookup/" + $("#frequency").val() / 1000, + cache: false, + dataType: "json", + success: function (dxspot) { + if ((dxspot.spotted ?? '') != '') { + reset_fields(); + $("#callsign").val(dxspot.spotted); + $("#callsign").trigger("blur"); + } else { + showToast(lang_general_word_info, lang_qso_no_spots_found, 'bg-info text-dark', 2000); + } + } + }); + } else { + showToast(lang_general_word_info, lang_qso_you_already_filled_an_qso, 'bg-info text-dark', 2000); + } }); function set_timers() {