From e640f904886345bc25bb2665a822283684d650c1 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 6 Jul 2021 15:00:31 +0200 Subject: [PATCH] Don't show archived lists/namespaces in quick actions --- src/components/quick-actions/quick-actions.vue | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/components/quick-actions/quick-actions.vue b/src/components/quick-actions/quick-actions.vue index 633c6e08..06201388 100644 --- a/src/components/quick-actions/quick-actions.vue +++ b/src/components/quick-actions/quick-actions.vue @@ -114,7 +114,21 @@ export default { query = query.substr(1) } + const ncache = {} + lists = (Object.values(this.$store.state.lists).filter(l => { + if (l.isArchived) { + return false + } + + if (typeof ncache[l.namespaceId] === 'undefined') { + ncache[l.namespaceId] = this.$store.getters['namespaces/getNamespaceById'](l.namespaceId) + } + + if (ncache[l.namespaceId].isArchived) { + return false + } + return l.title.toLowerCase().includes(query.toLowerCase()) }) ?? []) }