This commit is contained in:
Henry Jameson 2022-08-15 23:31:05 +03:00
parent 50f5afbce1
commit bbd99dc3cf
4 changed files with 8 additions and 9 deletions

View File

@ -17,14 +17,14 @@ const ListsTimeline = {
this.listId = route.params.id this.listId = route.params.id
this.$store.dispatch('stopFetchingTimeline', 'list') this.$store.dispatch('stopFetchingTimeline', 'list')
this.$store.commit('clearTimeline', { timeline: 'list' }) this.$store.commit('clearTimeline', { timeline: 'list' })
this.$store.dispatch('fetchList', { id: this.listId }) this.$store.dispatch('fetchList', { listId: this.listId })
this.$store.dispatch('startFetchingTimeline', { timeline: 'list', listId: this.listId }) this.$store.dispatch('startFetchingTimeline', { timeline: 'list', listId: this.listId })
} }
} }
}, },
created () { created () {
this.listId = this.$route.params.id this.listId = this.$route.params.id
this.$store.dispatch('fetchList', { id: this.listId }) this.$store.dispatch('fetchList', { listId: this.listId })
this.$store.dispatch('startFetchingTimeline', { timeline: 'list', listId: this.listId }) this.$store.dispatch('startFetchingTimeline', { timeline: 'list', listId: this.listId })
}, },
unmounted () { unmounted () {

View File

@ -1,7 +1,7 @@
import ListsMenuContent from 'src/components/lists_menu/lists_menu_content.vue' import ListsMenuContent from 'src/components/lists_menu/lists_menu_content.vue'
import { mapState, mapGetters } from 'vuex' import { mapState, mapGetters } from 'vuex'
import { TIMELINES, ROOT_ITEMS } from 'src/components/navigation/navigation.js' import { TIMELINES, ROOT_ITEMS } from 'src/components/navigation/navigation.js'
import { getListEntries, filterNavigation } from 'src/components/navigation/filter.js' import { filterNavigation } from 'src/components/navigation/filter.js'
import NavigationEntry from 'src/components/navigation/navigation_entry.vue' import NavigationEntry from 'src/components/navigation/navigation_entry.vue'
import NavigationPins from 'src/components/navigation/navigation_pins.vue' import NavigationPins from 'src/components/navigation/navigation_pins.vue'
import Checkbox from 'src/components/checkbox/checkbox.vue' import Checkbox from 'src/components/checkbox/checkbox.vue'
@ -81,7 +81,6 @@ const NavPanel = {
}, },
computed: { computed: {
...mapState({ ...mapState({
lists: getListEntries,
currentUser: state => state.users.currentUser, currentUser: state => state.users.currentUser,
followRequestCount: state => state.api.followRequests.length, followRequestCount: state => state.api.followRequests.length,
privateMode: state => state.instance.private, privateMode: state => state.instance.private,

View File

@ -10,7 +10,7 @@ export const filterNavigation = (list = [], { hasChats, isFederating, isPrivate,
}) })
} }
export const getListEntries = state => state.lists.allLists.map(list => ({ export const getListEntries = state => console.log(state.lists) || state.lists.allLists.map(list => ({
name: 'list-' + list.id, name: 'list-' + list.id,
routeObject: { name: 'lists-timeline', params: { id: list.id } }, routeObject: { name: 'lists-timeline', params: { id: list.id } },
labelRaw: list.title, labelRaw: list.title,

View File

@ -15,10 +15,10 @@ export const mutations = {
} }
state.allListsObject[listId].title = title state.allListsObject[listId].title = title
if (!find(state.allLists, { listId })) { if (!find(state.allLists, { id: listId })) {
state.allLists.push({ listId, title }) state.allLists.push({ id: listId, title })
} else { } else {
find(state.allLists, { listId }).title = title find(state.allLists, { id: listId }).title = title
} }
}, },
setListAccounts (state, { listId, accountIds }) { setListAccounts (state, { listId, accountIds }) {
@ -61,7 +61,7 @@ const actions = {
}, },
fetchList ({ rootState, commit }, { listId }) { fetchList ({ rootState, commit }, { listId }) {
return rootState.api.backendInteractor.getList({ listId }) return rootState.api.backendInteractor.getList({ listId })
.then((list) => commit('setList', { id: list.id, title: list.title })) .then((list) => commit('setList', { listId: list.id, title: list.title }))
}, },
fetchListAccounts ({ rootState, commit }, { listId }) { fetchListAccounts ({ rootState, commit }, { listId }) {
return rootState.api.backendInteractor.getListAccounts({ listId }) return rootState.api.backendInteractor.getListAccounts({ listId })