fix(client): Correct behavior for editting new tasks

This commit is contained in:
Blade Barringer
2016-09-13 12:11:56 -05:00
parent cbefc13e25
commit bbe4759691
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -1,4 +1,5 @@
import taskDefaults from '../libs/taskDefaults';
import clone from 'lodash/lang/clone';
// TODO move to client since it's only used there?
@@ -8,6 +9,9 @@ module.exports = function addTask (user, req = {body: {}}) {
user[`${task.type}s`].unshift(task);
task._editing = user.preferences.newTaskEdit;
if (task._editing) {
task._edit = clone(task);
}
task._tags = !user.preferences.tagsCollapsed;
task._advanced = !user.preferences.advancedCollapsed;