Migrates lists module to store
This commit is contained in:
parent
ad7d47f440
commit
8eff081468
13 changed files with 248 additions and 109 deletions
|
|
@ -11,7 +11,7 @@ export const filterNavigation = (list = [], { hasChats, hasAnnouncements, isFede
|
|||
})
|
||||
}
|
||||
|
||||
export const getListEntries = state => state.lists.allLists.map(list => ({
|
||||
export const getListEntries = store => store.allLists.map(list => ({
|
||||
name: 'list-' + list.id,
|
||||
routeObject: { name: 'lists-timeline', params: { id: list.id } },
|
||||
labelRaw: list.title,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { mapState } from 'vuex'
|
||||
import { mapState as mapPiniaState } from 'pinia'
|
||||
import { TIMELINES, ROOT_ITEMS, routeTo } from 'src/components/navigation/navigation.js'
|
||||
import { getListEntries, filterNavigation } from 'src/components/navigation/filter.js'
|
||||
|
||||
|
|
@ -14,6 +15,7 @@ import {
|
|||
faStream,
|
||||
faList
|
||||
} from '@fortawesome/free-solid-svg-icons'
|
||||
import { useListsStore } from '../../stores/lists'
|
||||
|
||||
library.add(
|
||||
faUsers,
|
||||
|
|
@ -38,8 +40,10 @@ const NavPanel = {
|
|||
getters () {
|
||||
return this.$store.getters
|
||||
},
|
||||
...mapPiniaState(useListsStore, {
|
||||
lists: getListEntries
|
||||
}),
|
||||
...mapState({
|
||||
lists: getListEntries,
|
||||
currentUser: state => state.users.currentUser,
|
||||
followRequestCount: state => state.api.followRequests.length,
|
||||
privateMode: state => state.instance.private,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue