Fetch list of lists from the API

This commit is contained in:
Sol Fisher Romanoff 2022-06-15 18:34:11 +03:00
parent d5d464a289
commit e18e179a59
No known key found for this signature in database
GPG key ID: 9D3F2B64F2341B62
4 changed files with 52 additions and 1 deletions

View file

@ -13,7 +13,8 @@ const api = {
socket: null,
mastoUserSocket: null,
mastoUserSocketStatus: null,
followRequests: []
followRequests: [],
lists: []
},
mutations: {
setBackendInteractor (state, backendInteractor) {
@ -35,6 +36,9 @@ const api = {
setFollowRequests (state, value) {
state.followRequests = value
},
setLists (state, value) {
state.lists = value
},
setMastoUserSocketStatus (state, value) {
state.mastoUserSocketStatus = value
},
@ -249,6 +253,18 @@ const api = {
store.commit('setFollowRequests', requests)
},
// Lists
startFetchingLists (store) {
if (store.state.fetchers['lists']) return
const fetcher = store.state.backendInteractor.startFetchingLists({ store })
store.commit('addFetcher', { fetcherName: 'lists', fetcher })
},
stopFetchingLists (store) {
const fetcher = store.state.fetchers.lists
if (!fetcher) return
store.commit('removeFetcher', { fetcherName: 'lists', fetcher })
},
// Pleroma websocket
setWsToken (store, token) {
store.commit('setWsToken', token)