fix(quick actions): don't show projects when searching for labels or tasks

This commit is contained in:
kolaente 2023-08-29 12:38:59 +02:00
parent d57e1909c4
commit 4e6b99544e
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 13 additions and 7 deletions

View File

@ -48,7 +48,7 @@
<x-label :label="i"/>
</template>
<template v-else-if="r.type === ACTION_TYPE.TASK">
<single-task-inline-readonly
<single-task-inline-readonly
:task="i"
:show-project="true"
/>
@ -148,12 +148,18 @@ function closeQuickActions() {
}
const foundProjects = computed(() => {
const {project, text} = parsedQuery.value
if (
searchMode.value === SEARCH_MODE.ALL ||
searchMode.value === SEARCH_MODE.PROJECTS ||
text === ''
) {
const {project, text, labels, assignees} = parsedQuery.value
if (project !== null) {
return projectStore.searchProject(project ?? text)
.filter(p => Boolean(p))
}
if (labels.length > 0 || assignees.length > 0) {
return []
}
if (text === '') {
const history = getHistory()
return history.map((p) => projectStore.projects[p.id])
.filter(p => Boolean(p))