From 71ed1bf89c065270e9733619ab2a3837fe340633 Mon Sep 17 00:00:00 2001 From: dudenamedjune Date: Sat, 1 Jun 2024 15:16:23 -0500 Subject: [PATCH] fix: create todo when empty --- src/App.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index d7a72df3..6f215b78 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -14,7 +14,9 @@ function App() { }, []); function createTodo() { - client.models.Todo.create({ content: window.prompt("Todo content") }); + const todo = window.prompt("Todo content") + if (!todo) return + client.models.Todo.create({ content: todo }); } return (