mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-12 02:35:42 +00:00
fix: removed wormhole only logic error
This commit is contained in:
@@ -17,8 +17,6 @@ const SystemKillsContent = () => {
|
|||||||
|
|
||||||
const [systemId] = selectedSystems || [];
|
const [systemId] = selectedSystems || [];
|
||||||
|
|
||||||
const systemStaticInfo = getSystemStaticInfo(systemId)!;
|
|
||||||
|
|
||||||
const { kills, isLoading, error } = useSystemKills({
|
const { kills, isLoading, error } = useSystemKills({
|
||||||
systemId,
|
systemId,
|
||||||
outCommand,
|
outCommand,
|
||||||
@@ -30,15 +28,26 @@ const SystemKillsContent = () => {
|
|||||||
const showLoading = isLoading && kills.length === 0;
|
const showLoading = isLoading && kills.length === 0;
|
||||||
|
|
||||||
const filteredKills = useMemo(() => {
|
const filteredKills = useMemo(() => {
|
||||||
if (!settingsKills.whOnly || !settingsKills.showAll) return kills;
|
if (!settingsKills.whOnly) return kills;
|
||||||
return kills.filter(kill => {
|
|
||||||
if (!systemStaticInfo) {
|
const whBySystem = new Map<number, boolean>();
|
||||||
console.warn(`System with id ${kill.solar_system_id} not found.`);
|
const wormholeKills = kills.filter(kill => {
|
||||||
return false;
|
const id = Number(kill.solar_system_id);
|
||||||
|
let isWH = whBySystem.get(id);
|
||||||
|
if (isWH === undefined) {
|
||||||
|
const info = getSystemStaticInfo(id);
|
||||||
|
if (!info || info.system_class == null) {
|
||||||
|
isWH = false;
|
||||||
|
} else {
|
||||||
|
isWH = isWormholeSpace(Number(info.system_class));
|
||||||
|
}
|
||||||
|
whBySystem.set(id, isWH);
|
||||||
}
|
}
|
||||||
return isWormholeSpace(systemStaticInfo.system_class);
|
return isWH;
|
||||||
});
|
});
|
||||||
}, [kills, settingsKills.whOnly, systemStaticInfo, settingsKills.showAll]);
|
|
||||||
|
return wormholeKills;
|
||||||
|
}, [kills, settingsKills.whOnly]);
|
||||||
|
|
||||||
if (!isSubscriptionActive) {
|
if (!isSubscriptionActive) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user