From c3e76e67a8be499afdcfb33b76f2a730d557f1c1 Mon Sep 17 00:00:00 2001 From: William Goodspeed Date: Thu, 23 Oct 2025 21:56:08 +0800 Subject: [PATCH] Introduce resubmission avoidance for contest logging The contest logging page doesn't have resubmission avoidance so users could click the save button multiple times and get duplicated QSOs. What's more, this happends more commonly in contest because of the high pace. The fix was borrowed from the implimentation in `assets/js/sections/qso.js'. Ref: https://github.com/wavelog/wavelog/blob/e4d17a2a07be52b12420cb351b35b72ab4c9e8fa/assets/js/sections/qso.js#L158 However, this looks great but could be annoying for slow servers. It could also be implemented by blanking the qso info earlier so that the user wouldn't be able to click again. But this may trick users to think the QSO was already uploaded when it really isn't. Signed-off-by: William Goodspeed --- application/views/contesting/index.php | 2 +- assets/js/sections/contesting.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/application/views/contesting/index.php b/application/views/contesting/index.php index 6e4aff2d4..33c286cbe 100644 --- a/application/views/contesting/index.php +++ b/application/views/contesting/index.php @@ -236,7 +236,7 @@ - + diff --git a/assets/js/sections/contesting.js b/assets/js/sections/contesting.js index b17bd8772..018ee70e9 100644 --- a/assets/js/sections/contesting.js +++ b/assets/js/sections/contesting.js @@ -650,6 +650,10 @@ function logQso() { // Only "Start a new contest session" will enable it again disabledContestnameSelect(true); + // Avoid resubmission by disabling the button + var saveQsoButtonText = $("#saveQso").html(); + $("#saveQso").html(' ' + saveQsoButtonText + '...').prop('disabled', true); + $('.callsign-suggestions').text(""); $('#callsign_info').text(""); @@ -747,6 +751,8 @@ function logQso() { var qTable = $('.qsotable').DataTable(); qTable.search('').order([0, 'desc']).draw(); + // Re-enable the previously disabled button for resubmission avoidance + $("#saveQso").html(saveQsoButtonText).prop("disabled", false); } }); }