2022-08-06 14:26:43 +00:00
|
|
|
import { mapState } from 'vuex'
|
2022-08-11 18:00:27 +00:00
|
|
|
import NavigationEntry from 'src/components/navigation/navigation_entry.vue'
|
2022-08-06 14:26:43 +00:00
|
|
|
|
2022-08-11 18:00:27 +00:00
|
|
|
export const getListEntries = state => state.lists.allLists.map(list => ({
|
|
|
|
name: 'list-' + list.id,
|
|
|
|
routeObject: { name: 'lists-timeline', params: { id: list.id } },
|
|
|
|
labelRaw: list.title,
|
|
|
|
iconLetter: list.title[0]
|
|
|
|
}))
|
2022-08-06 14:26:43 +00:00
|
|
|
|
2022-08-11 18:00:27 +00:00
|
|
|
export const ListsMenuContent = {
|
|
|
|
props: [
|
|
|
|
'showPin'
|
|
|
|
],
|
2022-08-06 14:26:43 +00:00
|
|
|
created () {
|
|
|
|
this.$store.dispatch('startFetchingLists')
|
|
|
|
},
|
2022-08-11 18:00:27 +00:00
|
|
|
components: {
|
|
|
|
NavigationEntry
|
|
|
|
},
|
2022-08-06 14:26:43 +00:00
|
|
|
computed: {
|
|
|
|
...mapState({
|
2022-08-11 18:00:27 +00:00
|
|
|
lists: getListEntries,
|
2022-08-06 14:26:43 +00:00
|
|
|
currentUser: state => state.users.currentUser,
|
|
|
|
privateMode: state => state.instance.private,
|
|
|
|
federating: state => state.instance.federating
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ListsMenuContent
|