mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-06-02 22:26:57 -05:00
Fix Hero Shot link 404 Closes #1477
This commit is contained in:
parent
b804d98a50
commit
9de50b525e
|
|
@ -36,6 +36,7 @@ import { Popover } from "./Popover";
|
|||
import { InfoIcon } from "./icons/Info";
|
||||
import { LockIcon } from "./icons/Lock";
|
||||
import type { BuildWeaponWithTop500Info } from "~/features/builds";
|
||||
import { altWeaponIdToId } from "~/modules/in-game-lists/weapon-ids";
|
||||
|
||||
interface BuildProps {
|
||||
build: Pick<
|
||||
|
|
@ -231,9 +232,12 @@ export function BuildCard({ build, owner, canEdit = false }: BuildProps) {
|
|||
|
||||
function RoundWeaponImage({ weapon }: { weapon: BuildWeaponWithTop500Info }) {
|
||||
const { weaponSplId, maxPower, minRank } = weapon;
|
||||
const normalizedWeaponSplId = altWeaponIdToId.get(weaponSplId) ?? weaponSplId;
|
||||
|
||||
const { t } = useTranslation(["weapons"]);
|
||||
const slug = mySlugify(t(`weapons:MAIN_${weaponSplId}`, { lng: "en" }));
|
||||
const slug = mySlugify(
|
||||
t(`weapons:MAIN_${normalizedWeaponSplId}`, { lng: "en" }),
|
||||
);
|
||||
|
||||
const isTop500 = typeof maxPower === "number" && typeof minRank === "number";
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ export const mainWeaponIds = weaponCategories
|
|||
.sort((a, b) => a - b);
|
||||
|
||||
export const weaponIdToAltId = new Map<MainWeaponId, MainWeaponId>([[40, 45]]);
|
||||
export const altWeaponIdToId = new Map<MainWeaponId, MainWeaponId>([[45, 40]]);
|
||||
|
||||
const altWeaponIds = new Set(weaponIdToAltId.values());
|
||||
export const weaponIdIsNotAlt = (weaponId: MainWeaponId) =>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user