misc: empty geolocation prefilled fields on empty response (#26219) #716

Merged
fpeters merged 1 commits from wip/26219-empty-geoloc-prefill-fields into main 2023-09-29 07:32:41 +02:00
1 changed files with 5 additions and 1 deletions

View File

@ -130,7 +130,11 @@ $(function() {
var widget_name = $(event.target).parents('div.widget').data('widget-name');
$.getJSON(WCS_ROOT_URL + '/api/reverse-geocoding?lat=' + coords.lat + '&lon=' + coords.lng, function(data) {
unset_sync_callback()
if (data.err) return;
if (data === null) {
data = {address: {road: undefined, house_number: undefined}}
} else if (data.err) {
return
}
var $prefilled_by_id = $('div[data-geolocation="address-id"]');
if ($prefilled_by_id.length) {