Fix filter definitions for TGO layers.

https://github.com/dcs-liberation/dcs_liberation/issues/2253
This commit is contained in:
Raffson 2022-06-22 10:57:36 +02:00 committed by GitHub
parent 7f05f6bc7d
commit 76bc0fde33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ export default function LiberationMap() {
<TgosLayer categories={["ship"]} />
</LayersControl.Overlay>
<LayersControl.Overlay name="Other ground objects" checked>
<TgosLayer categories={["aa", "factories", "ships"]} exclude />
<TgosLayer categories={["aa", "factory", "ship"]} exclude />
</LayersControl.Overlay>
<LayersControl.Overlay name="Supply routes" checked>
<SupplyRoutesLayer />

View File

@ -12,7 +12,7 @@ export default function TgosLayer(props: TgosLayerProps) {
const allTgos = Object.values(useAppSelector(selectTgos).tgos);
const categoryFilter = props.categories ?? [];
const tgos = allTgos.filter(
(tgo) => categoryFilter.includes(tgo.category) === (props.exclude ?? false)
(tgo) => categoryFilter.includes(tgo.category) === !(props.exclude ?? false)
);
return (
<LayerGroup>