Skip to content

Commit

Permalink
Don't mark pending todos as completed
Browse files Browse the repository at this point in the history
  • Loading branch information
marckohlbrugge committed Jun 2, 2020
1 parent 314fd31 commit 45a7a78
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "WIP",
"description": "Menubar app for WIP",
"version": "1.4.4",
"version": "1.4.5",
"author": "Marc Köhlbrugge <hey@marckohlbrugge.com>",
"bugs": {
"url": "https://github.com/marckohlbrugge/wip-menubar/issues"
Expand Down
3 changes: 1 addition & 2 deletions src/app.js
Expand Up @@ -518,14 +518,13 @@ app.on('ready', () => {
event.sender.send('NotificationTimeSet');
}

async function createTodo(event, value, attachments) {
async function createTodo(event, value, attachments, completed) {
if (value.match(/^\/help\b/i)) {
// Executing /help command
shell.openExternal('https://wip.chat/help#menubar');
event.sender.send('todoSaved');
} else {
// Creating a todo
const completed = !value.match(/^\/todo\b/i);
value = value.replace(/^\/(todo|done)\b/i, '');
var todo = wip.createTodo(value, completed, attachments);
event.sender.send('todoSaved');
Expand Down
3 changes: 2 additions & 1 deletion src/compose/compose.js
Expand Up @@ -171,7 +171,8 @@ const example = {
if (app.selected) {
ipc.send('completeTodo', app.selected.id, this.attachments);
} else {
ipc.send('createTodo', app.name, this.attachments);
let completed = this.state == 'done';
ipc.send('createTodo', app.name, this.attachments, completed);
}
},
getAsyncData: debounce(function() {
Expand Down

0 comments on commit 45a7a78

Please sign in to comment.