Added async to some JS-Functions to prevent Raceconds at state-dropper

This commit is contained in:
int2001
2024-02-18 08:13:14 +00:00
parent 5c0d123614
commit 8cd066dce3
2 changed files with 6 additions and 6 deletions

View File

@@ -309,8 +309,8 @@ function qso_edit(id) {
calcRemainingChars(event, '.modal-content');
});
$("#dxcc_id").change(function () {
updateStateDropdown();
$("#dxcc_id").change(async function () {
await updateStateDropdown();
});
},
});
@@ -318,12 +318,12 @@ function qso_edit(id) {
});
}
function updateStateDropdown() {
async function updateStateDropdown() {
console.log('dropdown triggered');
var selectedDxcc = $("#dxcc_id");
if (selectedDxcc.val() !== "") {
$.ajax({
await $.ajax({
url: base_url + "index.php/lookup/get_state_list",
type: "POST",
data: { dxcc: selectedDxcc.val() },
@@ -704,4 +704,4 @@ function statesDropdown(states, set_state = null) {
console.log("Ready to unleash your coding prowess and join the fun?\n\n" +
"Check out our GitHub Repository and dive into the coding adventure:\n\n" +
"🚀 https://www.github.com/wavelog/wavelog");
"🚀 https://www.github.com/wavelog/wavelog");

View File

@@ -721,7 +721,7 @@ $("#callsign").focusout(function() {
}
$('#dxcc_id').val(result.dxcc.adif);
updateStateDropdown();
await updateStateDropdown();
$('#cqz').val(result.dxcc.cqz);
$('#ituz').val(result.dxcc.ituz);