change only if ajax was successful

This commit is contained in:
HB9HIL
2024-05-03 18:32:55 +02:00
parent f80f409e0a
commit f6aec56593

View File

@@ -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);
}
}
}