     // we use filter instead of find for compatibility with IE11
          var task = tasks.filter(function (_, index) { return index == data.index })[0];
          if (task) {
            task.done = data.done;
          }
          break;
        case "ClearDoneTasks":
          tasks = tasks.filter(function (value) { return !value.done; });
          break;
      }

      if (data.cmd != "Log") {
        app.ports.fromRust.send(tasks);
      }
    })
  </script>
</body>

</html>