From 69eaccbdef48e3b00643d8a1bbc9621e5455e98f Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 26 Jul 2017 15:22:25 +0200 Subject: [PATCH] don't create empty todo entries --- www/todo/main.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/www/todo/main.js b/www/todo/main.js index 070e10349..2abe7b4aa 100644 --- a/www/todo/main.js +++ b/www/todo/main.js @@ -124,6 +124,10 @@ define([ var addTask = function () { var $input = $iframe.find('#newTodoName'); + // if the input is empty after removing leading and trailing spaces + // don't create a new entry + if (!$input.val().trim()) { return; } + var obj = { "state": 0, "task": $input.val(),