mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
fix(ui): explicit navigation releases flights when an engine leaves out military awareness
On Navara the military-awareness module has no controls, so its releaseCameraOwnership was skipped silently and a city pill, voice fly_to_location or reset ended the follow but kept the aircraft selected. The trackers it would release are released directly instead, as on Cesium (selection and follow both cleared).
This commit is contained in:
1 parent
2da7b6d0d9
commit
e007350645
3 files changed
+41
No files matched your search
@@ -811,3 +811,36 @@ test("north-up and tilt inside an engine's own follow keep following (Navara)",
|
||||
handle.stop();
|
||||
engine.destroy();
|
||||
});
|
||||
|
||||
test('a navigation releases the flights follow when military awareness has no controls (Navara)', () => {
|
||||
const stopped = [];
|
||||
const navigation = new NavigationController({
|
||||
viewer: null,
|
||||
engine: createFakeEngine(),
|
||||
tracking: {
|
||||
flightsLayer: {
|
||||
stopTracking: ({ origin }) => stopped.push(`flights:${origin}`),
|
||||
},
|
||||
militaryFlightsLayer: {
|
||||
stopTracking: ({ origin }) => stopped.push(`military:${origin}`),
|
||||
},
|
||||
satellitesLayer: {},
|
||||
aisLiveVesselsLayer: { clearSelection: () => stopped.push('vessels') },
|
||||
// A layer this engine leaves out: its module, without the controls.
|
||||
militaryAwarenessLayer: {},
|
||||
rocketLaunchesLayer: {},
|
||||
},
|
||||
isCockpitActive: () => false,
|
||||
cancelOrientation() {},
|
||||
clearLocation() {},
|
||||
cancelShareSelection() {},
|
||||
interruptCameraMotion() {},
|
||||
stopOrbit() {},
|
||||
showToast() {},
|
||||
});
|
||||
assert.equal(
|
||||
navigation._releaseFollowCamera({ preserveVesselSelection: false }),
|
||||
false,
|
||||
);
|
||||
assert.deepEqual(stopped, ['flights:tool', 'military:tool', 'vessels']);
|
||||
});
|
||||
Reference in new issue
Block a user