Fetch list of lists from the API
This commit is contained in:
parent
d5d464a289
commit
e18e179a59
4 changed files with 52 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue