Authenticate and subscribe to streaming after connection

This commit is contained in:
tusooa 2024-10-19 13:42:04 -04:00
commit dfbc2704d8
No known key found for this signature in database
GPG key ID: 42AEC43D48433C51
4 changed files with 70 additions and 18 deletions

View file

@ -87,6 +87,9 @@ const api = {
const { state, commit, dispatch, rootState } = store
const timelineData = rootState.statuses.timelines.friends
state.mastoUserSocket = state.backendInteractor.startUserSocket({ store })
state.mastoUserSocket.addEventListener('pleroma:authenticated', () => {
state.mastoUserSocket.subscribe('user')
})
state.mastoUserSocket.addEventListener(
'message',
({ detail: message }) => {