mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Ensure a unique ID for supply routes.
List indexes are not a reliable list key unless the list is static. Indexes will be reused when games are loaded, which prevents the state from updating reliably. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2167
This commit is contained in:
@@ -428,6 +428,7 @@ export type Tgo = {
|
||||
sidc: string;
|
||||
};
|
||||
export type SupplyRoute = {
|
||||
id: string;
|
||||
points: LatLng[];
|
||||
front_active: boolean;
|
||||
is_sea: boolean;
|
||||
|
||||
@@ -7,8 +7,8 @@ export default function SupplyRoutesLayer() {
|
||||
const routes = useAppSelector(selectSupplyRoutes).routes;
|
||||
return (
|
||||
<LayerGroup>
|
||||
{routes.map((route, idx) => {
|
||||
return <SupplyRoute key={idx} route={route} />;
|
||||
{routes.map((route) => {
|
||||
return <SupplyRoute key={route.id} route={route} />;
|
||||
})}
|
||||
</LayerGroup>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user