fix(quick actions): use default project when creating a new task via quick add magic without specifying a project
Resolves https://community.vikunja.io/t/keyboard-navigation/3098/2
This commit is contained in:
parent
ccd79a7089
commit
dc3930cfa7
|
|
@ -502,12 +502,13 @@ async function doCmd() {
|
|||
}
|
||||
|
||||
async function newTask() {
|
||||
if (currentProject.value === null) {
|
||||
return
|
||||
let projectId = authStore.settings.defaultProjectId
|
||||
if (currentProject.value.id) {
|
||||
projectId = currentProject.value.id
|
||||
}
|
||||
const task = await taskStore.createNewTask({
|
||||
title: query.value,
|
||||
projectId: currentProject.value.id,
|
||||
projectId,
|
||||
})
|
||||
success({message: t('task.createSuccess')})
|
||||
await router.push({name: 'task.detail', params: {id: task.id}})
|
||||
|
|
|
|||
|
|
@ -390,6 +390,9 @@ export const useTaskStore = defineStore('task', () => {
|
|||
}
|
||||
|
||||
foundProjectId = project === null ? null : project.id
|
||||
if (foundProjectId !== null) {
|
||||
return foundProjectId
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Else check if a project was passed as parameter
|
||||
|
|
|
|||
Loading…
Reference in New Issue