From 9e04fc0cf0ad18ec088b9d686cbcb814d54ea3b9 Mon Sep 17 00:00:00 2001 From: FaaizHaikal Date: Mon, 20 May 2024 00:01:40 +0700 Subject: [PATCH] fix: fix set val assignment --- src/components/NumberField.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/NumberField.jsx b/src/components/NumberField.jsx index 81fa00d..0689058 100644 --- a/src/components/NumberField.jsx +++ b/src/components/NumberField.jsx @@ -39,15 +39,15 @@ function NumberField(props) { function setValue(val) { let value_change; if (type === 'main') { - value_change *= 10; + value_change = val * 10; setMainValue(keys, value + value_change); } else if (type === 'walking') { switch (name) { case 'balance': - value_change /= 10; + value_change = val / 10; break; case 'pid': - value_change *= 10; + value_change = val * 10; break; default: value_change = val; @@ -62,7 +62,7 @@ function NumberField(props) { case 'x_offset': case 'y_offset': case 'z_offset': - value_change *= 10; + value_change = val * 10; break; default: value_change = val; @@ -74,10 +74,10 @@ function NumberField(props) { switch (keys) { case 'foot_height': case 'period_time': - value_change *= 10; + value_change = val * 10; break; default: - value_change /= 10; + value_change = val / 10; break; } break;