Option to enable streaming
This commit is contained in:
parent
505fb26061
commit
6acd889589
8 changed files with 62 additions and 4 deletions
|
@ -31,6 +31,18 @@ const api = {
|
|||
}
|
||||
},
|
||||
actions: {
|
||||
// Global MastoAPI socket control, in future should disable ALL sockets/(re)start relevant sockets
|
||||
enableMastoSockets (store) {
|
||||
const { state, dispatch } = store
|
||||
if (state.mastoUserSocket) return
|
||||
dispatch('startMastoUserSocket')
|
||||
},
|
||||
disableMastoSockets (store) {
|
||||
const { state, dispatch } = store
|
||||
if (!state.mastoUserSocket) return
|
||||
dispatch('stopMastoUserSocket')
|
||||
},
|
||||
|
||||
// MastoAPI 'User' sockets
|
||||
startMastoUserSocket (store) {
|
||||
const { state, dispatch } = store
|
||||
|
@ -81,6 +93,12 @@ const api = {
|
|||
dispatch('stopFetchingNotifications')
|
||||
})
|
||||
},
|
||||
stopMastoUserSocket ({ state, dispatch }) {
|
||||
dispatch('startFetchingTimeline', { timeline: 'friends' })
|
||||
dispatch('startFetchingNotifications')
|
||||
console.log(state.mastoUserSocket)
|
||||
state.mastoUserSocket.close()
|
||||
},
|
||||
|
||||
// Timelines
|
||||
startFetchingTimeline (store, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue