Fixed issue where the float could be incorrect for a new skin
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user