fix(OneClient-Memory): Not being able to be set to 0
This commit is contained in:
parent
68145b4098
commit
9237291301
2 changed files with 13 additions and 4 deletions
|
|
@ -100,11 +100,16 @@ function RouteComponent() {
|
|||
<div className="flex flex-row items-center gap-x-2">
|
||||
<TextField
|
||||
className="text-center"
|
||||
min={0}
|
||||
onBlur={() => {
|
||||
updateProfile({ mem_max: profile.mem_max ?? 0 });
|
||||
}}
|
||||
onChange={(e) => {
|
||||
updateProfile({ mem_max: Number(e.currentTarget.value) });
|
||||
const raw = e.currentTarget.value;
|
||||
updateProfile({ mem_max: raw === '' ? undefined : Math.max(0, Number(raw)), });
|
||||
}}
|
||||
type="number"
|
||||
value={profile.mem_max ?? undefined}
|
||||
value={profile.mem_max ?? ''}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -104,11 +104,15 @@ export function GameSettings() {
|
|||
<div className="flex flex-row items-center gap-x-2">
|
||||
<TextField
|
||||
className="text-center"
|
||||
onBlur={() => {
|
||||
setSetting('mem_max', gameSettings.mem_max ?? 0);
|
||||
}}
|
||||
onChange={(e) => {
|
||||
setSetting('mem_max', Number(e.currentTarget.value));
|
||||
const raw = e.currentTarget.value;
|
||||
setSetting('mem_max', raw === '' ? null : Math.max(0, Number(raw)));
|
||||
}}
|
||||
type="number"
|
||||
value={gameSettings.mem_max ?? undefined}
|
||||
value={gameSettings.mem_max ?? ''}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue