fix: creating a new task while specifying the list in quick add magic
This commit is contained in:
parent
1d2abf56f9
commit
f884020c55
1 changed files with 6 additions and 6 deletions
|
@ -264,7 +264,7 @@ export default {
|
||||||
|
|
||||||
// label not found, create it
|
// label not found, create it
|
||||||
const labelModel = new LabelModel({title: labelTitle})
|
const labelModel = new LabelModel({title: labelTitle})
|
||||||
return dispatch('labels/createLabel', labelModel).then(() => resolve(label))
|
return dispatch('labels/createLabel', labelModel, {root: true}).then(() => resolve(label))
|
||||||
})
|
})
|
||||||
.then((label) => addLabelToTask(task, label))
|
.then((label) => addLabelToTask(task, label))
|
||||||
.catch(e => Promise.reject(e)),
|
.catch(e => Promise.reject(e)),
|
||||||
|
@ -274,18 +274,18 @@ export default {
|
||||||
return Promise.all(labelAddsToWaitFor).then(() => task)
|
return Promise.all(labelAddsToWaitFor).then(() => task)
|
||||||
},
|
},
|
||||||
|
|
||||||
findListId({ rootGetters }, { list, listId }) {
|
findListId({ rootGetters }, { list: listName, listId }) {
|
||||||
let foundListId = null
|
let foundListId = null
|
||||||
|
|
||||||
// Uses the following ways to get the list id of the new task:
|
// Uses the following ways to get the list id of the new task:
|
||||||
// 1. If specified in quick add magic, look in store if it exists and use it if it does
|
// 1. If specified in quick add magic, look in store if it exists and use it if it does
|
||||||
if (list !== null) {
|
if (listName !== null) {
|
||||||
const list = rootGetters['lists/findListByExactname'](list)
|
const list = rootGetters['lists/findListByExactname'](listName)
|
||||||
foundListId = list === null ? null : list.id
|
foundListId = list === null ? null : list.id
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Else check if a list was passed as parameter
|
// 2. Else check if a list was passed as parameter
|
||||||
if (listId !== 0) {
|
if (foundListId === null && listId !== 0) {
|
||||||
foundListId = listId
|
foundListId = listId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue