From f6aec56593e95a4c0fabd2f7def2ebdaaaa5e3a6 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Fri, 3 May 2024 18:32:55 +0200 Subject: [PATCH] change only if ajax was successful --- assets/js/sections/common.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js index 2676970e0..017745cfb 100644 --- a/assets/js/sections/common.js +++ b/assets/js/sections/common.js @@ -895,19 +895,19 @@ function set_active_loc_quickswitcher(new_active) { if (typeof reloadStations === 'function') { reloadStations(); } + + // If the user is in the QSO view we change the station in the QSO input aswell + if (window.location.pathname.indexOf("qso") !== -1) { + if ($('#stationProfile option[value="' + new_active + '"]').length > 0) { + $('#stationProfile').val(new_active); + } + } }, error: function(xhr, status, error) { console.error('Error while setting the new active location: ' + error); } }); }); - - // If the user is in the QSO view we change the station in the QSO input aswell - if (window.location.pathname.indexOf("qso") !== -1) { - if ($('#stationProfile option[value="' + new_active + '"]').length > 0) { - $('#stationProfile').val(new_active); - } - } }