Skip to content

Commit e32d368

Browse files
committed
fix: account for empty inputs in dev app
1 parent 5546ef2 commit e32d368

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/idb-cache-app/src/App.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ const App = () => {
306306
renderLabel="Item size (KiB):"
307307
onChange={(e) => {
308308
const newValue = Math.max(
309-
Number.parseInt(e.target.value, 10) * 1024,
309+
Number.parseInt(e.target.value || "0", 10) * 1024,
310310
1024,
311311
);
312312
setItemSize(newValue);
@@ -335,7 +335,7 @@ const App = () => {
335335
renderLabel="Chunk size (KiB):"
336336
onChange={(e) => {
337337
const newValue = Math.max(
338-
Number.parseInt(e.target.value, 10) * 1024,
338+
Number.parseInt(e.target.value || "0", 10) * 1024,
339339
1024,
340340
);
341341
setChunkSize(newValue);
@@ -354,7 +354,8 @@ const App = () => {
354354
<NumberInput
355355
renderLabel="Max total chunks:"
356356
onChange={(e) => {
357-
const newValue = Number.parseInt(e.target.value, 10) || 1;
357+
const newValue =
358+
Number.parseInt(e.target.value || "0", 10) || 1;
358359
setMaxTotalChunksStored(newValue);
359360
}}
360361
onIncrement={() => {

0 commit comments

Comments
 (0)