Skip to content

Commit

Permalink
fix: logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Jensen committed Oct 22, 2023
1 parent 68d7759 commit c73a567
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/AircraftPositionProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function AircraftPositionProvider(props: PropsWithChildren<AircraftPositi

/* Callback to invoke the position service and update state. */
const updatePositions = () => {
console.log("updatePositions()")
service.getPositions(state.modeSCodes)
.then(positions => {
updateState(previous => produce(previous, draft => {
Expand All @@ -61,6 +62,7 @@ export function AircraftPositionProvider(props: PropsWithChildren<AircraftPositi

/* Calculate delay until next update; if <= 0, invoke now, else invoke after timeout. */
const delay = DateTime.now().diff(state.nextUpdate).toMillis();
console.log("Delay", delay);
if (delay <= 0) {
updatePositions();
} else {
Expand Down

0 comments on commit c73a567

Please sign in to comment.