From b1fa006a0dcf9b8d9ab61b46f03a9bc4b488e4e7 Mon Sep 17 00:00:00 2001 From: AINDUSTRIES Date: Wed, 30 Sep 2026 01:12:36 +0200 Subject: [PATCH] Fixed issue where the float could be incorrect for a new skin --- app/components/float.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/components/float.tsx b/app/components/float.tsx index 93cefd9..62d5120 100644 --- a/app/components/float.tsx +++ b/app/components/float.tsx @@ -20,6 +20,15 @@ export function Float({ acceptInput?: boolean; hasLabel?: boolean; }) { + useEffect(() => { + const newSkin = new WeaponInfo(skin); + newSkin.float = Math.max( + skin.min_float, + Math.min(skin.max_float, skin.float), + ); + setSkin(newSkin); + }, [skin.min_float, skin.max_float]); + const handleChange = (newValue: number | number[]) => { const val = Array.isArray(newValue) ? newValue[0] : newValue; const newSkin = new WeaponInfo(skin);