forked from vikunja/frontend
chore: refactor different namespace check to use a computed function
This commit is contained in:
parent
d87550fbd2
commit
fed3014c7b
|
@ -43,7 +43,7 @@
|
|||
v-if="props.option.listId !== listId"
|
||||
>
|
||||
<span
|
||||
v-if="$store.getters['namespaces/getListAndNamespaceById'](props.option.listId) !== null && $store.getters['namespaces/getListAndNamespaceById'](props.option.listId).namespace.id !== namespace.id"
|
||||
v-if="namespaceIsDifferent(props.option.listId)"
|
||||
v-tooltip="$t('task.relation.differentNamespace')">
|
||||
{{
|
||||
$store.getters['namespaces/getListAndNamespaceById'](props.option.listId).namespace.title
|
||||
|
@ -93,7 +93,7 @@
|
|||
v-if="t.listId !== listId"
|
||||
>
|
||||
<span
|
||||
v-if="$store.getters['namespaces/getListAndNamespaceById'](t.listId) !== null && $store.getters['namespaces/getListAndNamespaceById'](t.listId).namespace.id !== namespace.id"
|
||||
v-if="namespaceIsDifferent(t.listId)"
|
||||
v-tooltip="$t('task.relation.differentNamespace')">
|
||||
{{
|
||||
$store.getters['namespaces/getListAndNamespaceById'](t.listId).namespace.title
|
||||
|
@ -206,6 +206,12 @@ export default {
|
|||
namespace() {
|
||||
return this.$store.getters['namespaces/getListAndNamespaceById'](this.listId)?.namespace
|
||||
},
|
||||
namespaceIsDifferent() {
|
||||
return listId => {
|
||||
const namespace = this.$store.getters['namespaces/getListAndNamespaceById'](listId)
|
||||
return namespace !== null && namespace.id !== this.namespace.id
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async findTasks(query) {
|
||||
|
|
Loading…
Reference in New Issue