From 3e128adaa409094d1f6cbab6498e1eadb2645f23 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Tue, 25 Nov 2025 20:51:04 +0200 Subject: [PATCH] Fix weapon search alt name + real name match not working together --- app/modules/in-game-lists/utils.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/modules/in-game-lists/utils.ts b/app/modules/in-game-lists/utils.ts index b85ac5882..4b82cb2b3 100644 --- a/app/modules/in-game-lists/utils.ts +++ b/app/modules/in-game-lists/utils.ts @@ -1,8 +1,5 @@ import type { AnyWeapon } from "~/features/build-analyzer"; -import { - allWeaponAltNames, - weaponAltNames, -} from "~/modules/in-game-lists/weapon-alt-names"; +import { weaponAltNames } from "~/modules/in-game-lists/weapon-alt-names"; import { abilities } from "./abilities"; import type { Ability } from "./types"; @@ -26,12 +23,15 @@ export function filterWeapon({ const normalizedSearchTerm = normalizeTerm(searchTerm); const normalizedWeaponName = normalizeTerm(weaponName); - const isAlt = allWeaponAltNames.has(normalizedSearchTerm); - if (weapon.type === "MAIN" && isAlt) { + if (normalizedWeaponName.includes(normalizedSearchTerm)) { + return true; + } + + if (weapon.type === "MAIN") { return ( weaponAltNames.get(weapon.id)?.includes(normalizedSearchTerm) ?? false ); } - return normalizedWeaponName.includes(normalizedSearchTerm); + return false; }