fixes
This commit is contained in:
parent
45c394881f
commit
4909c87a6f
1 changed files with 12 additions and 1 deletions
|
|
@ -966,7 +966,7 @@ function focusTask(username, task) {
|
|||
};
|
||||
}
|
||||
|
||||
if (task.includes(",")) {
|
||||
if (taskSeparator.some((separator) => task.includes(separator))) {
|
||||
return {
|
||||
status: 1,
|
||||
body: {
|
||||
|
|
@ -1029,6 +1029,17 @@ function focusTask(username, task) {
|
|||
};
|
||||
}
|
||||
|
||||
// if task is already completed, return 2
|
||||
if (tasks[username].todos[index].done) {
|
||||
return {
|
||||
status: 2,
|
||||
body: {
|
||||
"error message": `@${username} task is already completed`,
|
||||
error: responses.specifyFocusTask,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
// set all tasks to unfocused
|
||||
for (const task of tasks[username].todos) {
|
||||
task.focus = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue