From c094b5175a0c7c2308cff7d4917685088b4695bb Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 6 Jul 2021 22:58:06 +0200 Subject: [PATCH] Show recently visited lists in quick actions --- src/components/quick-actions/quick-actions.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/quick-actions/quick-actions.vue b/src/components/quick-actions/quick-actions.vue index 2e9a8b2cb..a428e762f 100644 --- a/src/components/quick-actions/quick-actions.vue +++ b/src/components/quick-actions/quick-actions.vue @@ -63,6 +63,7 @@ import {CURRENT_LIST, LOADING, LOADING_MODULE, QUICK_ACTIONS_ACTIVE} from '@/sto import ListModel from '@/models/list' import createTask from '@/components/tasks/mixins/createTask' import QuickAddMagic from '@/components/tasks/partials/quick-add-magic' +import {getHistory} from '@/modules/listHistory' const TYPE_LIST = 'list' const TYPE_TASK = 'task' @@ -117,7 +118,15 @@ export default { const ncache = {} - lists = (Object.values(this.$store.state.lists).filter(l => { + const history = getHistory() + // Puts recently visited lists at the top + const allLists = [...new Set([ + ...history.map(l => { + return this.$store.getters['lists/getListById'](l.id) + }), + ...Object.values(this.$store.state.lists)])] + + lists = (allLists.filter(l => { if (l.isArchived) { return false }