v1.11.0: hide open-package rows with no grounded plane at the origin (ISS-159)
CI / build + unit + e2e (pull_request) Successful in 5m25s
CI / build + unit + e2e (pull_request) Successful in 5m25s
This commit is contained in:
@@ -46,6 +46,15 @@ export function loadEligiblePlanes(state: StateSnapshot, pkg: PackageState): Pla
|
||||
});
|
||||
}
|
||||
|
||||
// v1.11.0 (ISS-159): the open packages the market list shows — hidden while no GROUNDED plane sits at
|
||||
// their origin ("jobs for planes that are in air" disappear until landing). Payload-blocked rows stay:
|
||||
// a grounded plane at the origin keeps the row visible with its disabled Load button.
|
||||
export function visibleOpenPackages(state: StateSnapshot): PackageState[] {
|
||||
return state.packages.filter(
|
||||
(p) => p.status === 'open' && state.planes.some((pl) => pl.status === 'available' && pl.locationIcao === p.originIcao),
|
||||
);
|
||||
}
|
||||
|
||||
// Load controls for one open package: a single Load button when exactly one plane
|
||||
// is eligible (it acts on that plane directly), a small plane picker + Load when
|
||||
// several are, and a disabled button with the reason otherwise. Each row owns its
|
||||
@@ -141,7 +150,7 @@ export default function RightPane({ state, loading, applySnapshot, onHover, onEr
|
||||
if (!state) return null;
|
||||
|
||||
const clockMs = state.simState.clockMs;
|
||||
const open = state.packages.filter((p) => p.status === 'open');
|
||||
const open = visibleOpenPackages(state);
|
||||
|
||||
const catalog = state.catalog;
|
||||
const buyEntry = catalog.find((e) => e.model === buyModelId) ?? catalog[0] ?? null;
|
||||
|
||||
Reference in New Issue
Block a user