From 789bc3421ff8a8efde150dd378ae45cbe74e0aeb Mon Sep 17 00:00:00 2001 From: int2001 Date: Thu, 4 Jan 2024 05:54:42 +0000 Subject: [PATCH] Fix racecondition at contesting, where setSession can be called before deleteSession is called/finished --- assets/js/sections/contesting.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/js/sections/contesting.js b/assets/js/sections/contesting.js index c851e070e..05ec4a274 100644 --- a/assets/js/sections/contesting.js +++ b/assets/js/sections/contesting.js @@ -9,7 +9,14 @@ $(document).ready(async function () { }); // Resets the logging form and deletes session from database -function reset_contest_session() { +async function reset_contest_session() { + await $.ajax({ + url: base_url + 'index.php/contesting/deleteSession', + type: 'post', + success: function (data) { + + } + }); $('#name').val(""); $('.callsign-suggestions').text(""); $('#callsign').val(""); @@ -29,13 +36,6 @@ function reset_contest_session() { $(".contest_qso_table_contents").empty(); $('#copyexchangetodok').prop('checked', false); - $.ajax({ - url: base_url + 'index.php/contesting/deleteSession', - type: 'post', - success: function (data) { - - } - }); } // Storing the contestid in contest session