Skip to content

Commit

Permalink
[fix] send task check incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
hkgnp committed Apr 22, 2023
1 parent ee90760 commit 92fe4d2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "logseq-todoist-plugin",
"version": "5.2.2",
"version": "5.2.3",
"author": "hkgnp",
"description": "Simple Todoist plugin to pull only active tasks from specified project, i.e. Inbox",
"logseq": {
Expand Down
33 changes: 17 additions & 16 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import "@logseq/libs";
import handleListeners from "./utils/handleListeners";
import callSettings from "./services/settings";

import React from "react";
import ReactDOM from "react-dom";
import SendTask from "./components/SendTask";
Expand All @@ -23,31 +22,33 @@ async function main() {
logseq.settings!;
let content: string = (await logseq.Editor.getEditingBlockContent()).trim();

if (content === "") {
logseq.UI.showMsg("Task cannot be empty!", "error");
return;
}

if (
sendDefaultProject !== "--- ---" ||
sendDefaultLabel !== "--- ---" ||
sendDefaultProject === "--- ---" ||
sendDefaultProject === "" ||
sendDefaultLabel === "--- ---" ||
sendDefaultLabel === "" ||
sendDefaultDeadline
) {
ReactDOM.render(
<React.StrictMode>
<SendTask content={content} uuid={e.uuid} />
</React.StrictMode>,
document.getElementById("app")
);
logseq.showMainUI();
} else {
await sendTaskToTodoist(
e.uuid,
content,
getIdFromString(sendDefaultProject),
getIdFromString(sendDefaultLabel),
sendDefaultDeadline ? "today" : ""
);
} else {
if (content === "") {
logseq.UI.showMsg("Task cannot be empty!", "error");
return;
} else {
ReactDOM.render(
<React.StrictMode>
<SendTask content={content} uuid={e.uuid} />
</React.StrictMode>,
document.getElementById("app")
);
logseq.showMainUI();
}
}
});

Expand Down

0 comments on commit 92fe4d2

Please sign in to comment.