diff --git a/frontend/src/components/quick-actions/QuickActions.vue b/frontend/src/components/quick-actions/QuickActions.vue index 88de92903..bf9aea1fb 100644 --- a/frontend/src/components/quick-actions/QuickActions.vue +++ b/frontend/src/components/quick-actions/QuickActions.vue @@ -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}}) diff --git a/frontend/src/stores/tasks.ts b/frontend/src/stores/tasks.ts index d00674446..9eff65ab4 100644 --- a/frontend/src/stores/tasks.ts +++ b/frontend/src/stores/tasks.ts @@ -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