Skip to content

Commit

Permalink
fix: fpl prefilling
Browse files Browse the repository at this point in the history
  • Loading branch information
jpedroh committed Sep 6, 2022
1 parent 327bde7 commit afdca56
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/front/src/components/FlightModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const FlightModal: FC<Props> = ({ show, onClose, flight }) => {
<span>CRUISING SPEED </span> {flight.cruisingSpeed}
</p>
<p>
<span>FL </span> {flight.cruisingLevel}
<span>FL </span> {flight.cruisingLevel.toString().padStart(3, "0")}
</p>
</div>

Expand Down
2 changes: 1 addition & 1 deletion packages/front/src/components/IcaoFpl/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const getIcaoFpl = (flight: Flight) => {
`(FPL-${flight.callsign}-${formatFlightRules(flight.flightRules)}S`,
`-1/${flight.aircraft.icaoCode}/${flight.aircraft.wakeTurbulence}-${flight.aircraft.equipment}/L1B1`,
`-${flight.departureIcao}${flight.estimatedOffBlockTime}`,
`-${flight.cruisingSpeed}F${flight.cruisingLevel} ${flight.route}`,
`-${flight.cruisingSpeed}F${flight.cruisingLevel.toString().padStart(3, "0")} ${flight.route}`,
`-${flight.arrivalIcao}${formatEet(flight.estimatedEnrouteMinutes)}`,
`-${flight.remarks})`
]
Expand Down
2 changes: 1 addition & 1 deletion packages/front/src/components/IvaoButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const IvaoButton: FC<Props> = ({ flight }) => {
value={flight.cruisingSpeed.substr(1)}
/>
<input type="hidden" name="LEVELTYPE" value="F" />
<input type="hidden" name="LEVEL" value={flight.cruisingLevel} />
<input type="hidden" name="LEVEL" value={flight.cruisingLevel.toString().padStart(3, "0")} />
<input type="hidden" name="ROUTE" value={flight.route} />
<input type="hidden" name="DESTICAO" value={flight.arrivalIcao} />
<input
Expand Down
2 changes: 1 addition & 1 deletion packages/front/src/components/SkyVectorButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type Props = {
}

const SkyVectorButton: FC<Props> = ({ flight }) => {
const skyVectorLink = `https://skyvector.com/?fpl=${flight.cruisingSpeed}F${flight.cruisingLevel} ${flight.departureIcao} ${flight.route} ${flight.arrivalIcao}`
const skyVectorLink = `https://skyvector.com/?fpl=${flight.cruisingSpeed}F${flight.cruisingLevel.toString().padStart(3, "0")} ${flight.departureIcao} ${flight.route} ${flight.arrivalIcao}`

return (
<Button href={skyVectorLink} target="_blank">
Expand Down
2 changes: 1 addition & 1 deletion packages/front/src/components/VatsimButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const VatsimButton: FC<Props> = ({ flight }) => {
flight.callsign
}&3=${flight.aircraft.icaoCode}&4=${flight.cruisingSpeed}&5=${
flight.departureIcao
}&6=${flight.estimatedOffBlockTime}&7=${flight.cruisingLevel}&8=${
}&6=${flight.estimatedOffBlockTime}&7=${flight.cruisingLevel.toString().padStart(3, "0")}&8=${
flight.route
}&9=${flight.arrivalIcao}&10a=${Math.floor(
flight.estimatedEnrouteMinutes / 60
Expand Down

0 comments on commit afdca56

Please sign in to comment.