Skip to content

Commit

Permalink
save task only when task body exists
Browse files Browse the repository at this point in the history
  • Loading branch information
dromse committed Aug 13, 2024
1 parent d200ac7 commit d8fa653
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/tabs/Tasks/TaskEditor/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Task } from "@hooks/useTasks/types";
import { Notice } from "obsidian";
import React from "react";
import { Dialog, DialogProps } from "../Dialog";
import BindEditor from "./BindEditor";
Expand Down Expand Up @@ -28,6 +29,11 @@ export const TaskEditor = (props: TaskEditorProps): React.JSX.Element => {

<button
onClick={() => {
if (!newTask.body) {
new Notice("Task body is empty!");
return;
}

saveTask(newTask, setNewTask);
}}
>
Expand Down

0 comments on commit d8fa653

Please sign in to comment.