announcements (#42)

Reviewed-on: https://akkoma.dev/AkkomaGang/pleroma-fe/pulls/42
This commit is contained in:
floatingghost 2022-07-18 13:08:50 +00:00
parent 2977edc04d
commit fab72940c4
58 changed files with 1514 additions and 175 deletions

View file

@ -163,6 +163,7 @@ const api = {
dispatch('startFetchingTimeline', { timeline: 'friends' })
dispatch('startFetchingNotifications')
dispatch('startFetchingChats')
dispatch('startFetchingAnnouncements')
dispatch('pushGlobalNotice', {
level: 'error',
messageKey: 'timeline.socket_broke',
@ -261,6 +262,18 @@ const api = {
store.commit('removeFetcher', { fetcherName: 'lists', fetcher })
},
// Lists
startFetchingAnnouncements (store) {
if (store.state.fetchers['announcements']) return
const fetcher = store.state.backendInteractor.startFetchingAnnouncements({ store })
store.commit('addFetcher', { fetcherName: 'announcements', fetcher })
},
stopFetchingAnnouncements (store) {
const fetcher = store.state.fetchers.announcements
if (!fetcher) return
store.commit('removeFetcher', { fetcherName: 'announcements', fetcher })
},
// Pleroma websocket
setWsToken (store, token) {
store.commit('setWsToken', token)