Skip to content

Commit

Permalink
fix: discontinuity in properly strung arrival (#7113)
Browse files Browse the repository at this point in the history
  • Loading branch information
tracernz authored and aguther committed Apr 29, 2022
1 parent 9748351 commit a8694d4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,12 @@ class FacilityLoader {
}
}

const pendingRequest = this._pendingRawRequests.get(`${type}${_data.icaoTrimed}`);
if (pendingRequest) {
clearTimeout(pendingRequest.timeout);
pendingRequest.resolve(_data);
const pendingRequests = this._pendingRawRequests.get(`${type}${_data.icaoTrimed}`);
if (pendingRequests) {
pendingRequests.forEach((pendingRequest) => {
clearTimeout(pendingRequest.timeout);
pendingRequest.resolve(_data);
});
this._pendingRawRequests.delete(`${type}${_data.icaoTrimed}`);
}
}
Expand All @@ -138,8 +140,13 @@ class FacilityLoader {
icao: icao.trim()
};

this._pendingRawRequests.set(`${type}${request.icao}`, request);
Coherent.call(loadCall, icao).catch(console.error);
const pendingRequests = this._pendingRawRequests.get(`${type}${request.icao}`);
if (pendingRequests) {
pendingRequests.push(request);
} else {
this._pendingRawRequests.set(`${type}${request.icao}`, [request]);
Coherent.call(loadCall, icao).catch(console.error);
}
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/fmgc/src/flightplanning/ManagedFlightPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ export class ManagedFlightPlan {
for (let i = 0; i < toDeleteFromB; i++) {
this.removeWaypoint(segmentB.offset, true);
}
if (toDeleteFromB === 0 && !ManagedFlightPlan.legsStartOrEndAtSameFix(lastLegA, firstLegB)) {
if (toDeleteFromB === 0 && firstLegB.additionalData.legType === LegType.IF) {
lastLegA.endsInDiscontinuity = true;
lastLegA.discontinuityCanBeCleared = true;
}
Expand Down

0 comments on commit a8694d4

Please sign in to comment.