Fixed bug when changing gloves

This commit is contained in:
2026-09-28 01:20:33 +02:00
parent 31ac45f052
commit d89b679d08

View File

@@ -31,6 +31,7 @@ export function SkinSelector({
const setPaint = (v: Info) => { const setPaint = (v: Info) => {
if (skin instanceof WeaponInfo) { if (skin instanceof WeaponInfo) {
const newSkin = new WeaponInfo(skin); const newSkin = new WeaponInfo(skin);
newSkin.name = v.name;
newSkin.paint_index = v.paint_index; newSkin.paint_index = v.paint_index;
newSkin.display = v.display === "" ? newSkin.display : newSkin.display.split("|")[0] + " | " + v.display; newSkin.display = v.display === "" ? newSkin.display : newSkin.display.split("|")[0] + " | " + v.display;
newSkin.min_float = v.min_float; newSkin.min_float = v.min_float;
@@ -48,7 +49,7 @@ export function SkinSelector({
useEffect(() => { useEffect(() => {
const fetchSkins = async () => { const fetchSkins = async () => {
let response = await fetch( let response = await fetch(
`${import.meta.env.VITE_BASE_API_URL}/index?weapon=${skin.weapon_id}&team=${side}${skin instanceof AgentInfo ? "&agent=true" : ""}`, `${import.meta.env.VITE_BASE_API_URL}/index?weapon=${skin.weapon_id}&team=${side}${skin instanceof AgentInfo ? "&agent=true" : ""}&gloves=${skin.name.includes("gloves") || skin.name.includes("wraps")}`,
{ credentials: "include" }, { credentials: "include" },
) )
.then((r) => r.json()) .then((r) => r.json())