Merge pull request 'don't use default distance of 11; don't overwrite distance if already entered' (#473) from logbook-entry-improvement into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m42s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 6m15s

Reviewed-on: #473
This commit is contained in:
philipp 2024-04-30 21:31:33 +02:00
commit a75ba765df

View File

@ -189,11 +189,6 @@ function selectBoatChange() {
inputElement.value = formattedDateTime;
const distinput = <HTMLInputElement>(
document.querySelector("#distance_in_km")
);
distinput.value = "";
const destinput = <HTMLInputElement>(
document.querySelector("#destination")
);
@ -759,9 +754,11 @@ function addRelationMagic(bodyElement: HTMLElement) {
},
);
if (option && option.value !== ""){
// Get distance
const distance = option.getAttribute("distance");
if (distance) relatedField.value = distance;
if (distance && relatedField.value === "") relatedField.value = distance;
}
}
});
}