Skip to content

Commit

Permalink
lol
Browse files Browse the repository at this point in the history
  • Loading branch information
jbud committed Dec 10, 2023
1 parent b65fcea commit 405364b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/form/formutils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,33 +173,34 @@ export const useApi = (): [
.then((response) => response.json())
.then((data) => {
let dataMissing = false;
let extrapolatedHeading = '0';
let extrapolatedHeadingH,
extrapolatedHeadingL = '0';
const rws = data.runways;
const rwList: RunwaysForm[] = []; //{ value: '', heading: '', elevation: '', length: '' },
for (let i = 0; i < rws.length; i++) {
if (rws[i].he_heading_degT === '') {
// convert runway ident to heading
extrapolatedHeading =
rws[i].he_ident.substring(0, 2) + 0;
extrapolatedHeadingH =
rws[i].he_ident.substring(0, 2) + '0';
dataMissing = true;
}
if (rws[i].le_heading_degT === '') {
extrapolatedHeading =
rws[i].le_ident.substring(0, 2) + 0;
extrapolatedHeadingL =
rws[i].le_ident.substring(0, 2) + '0';
dataMissing = true;
}
rwList.push({
value: rws[i].he_ident,
heading: dataMissing
? extrapolatedHeading
? extrapolatedHeadingH
: rws[i].he_heading_degT,
elevation: data.elevation_ft,
length: rws[i].length_ft,
});
rwList.push({
value: rws[i].le_ident,
heading: dataMissing
? extrapolatedHeading
? extrapolatedHeadingL
: rws[i].le_heading_degT,
elevation: data.elevation_ft,
length: rws[i].length_ft,
Expand Down

0 comments on commit 405364b

Please sign in to comment.