Merge branch 'tusooa/streaming-op-after-conn' into 'develop'

Authenticate and subscribe to streaming after connection

See merge request pleroma/pleroma-fe!1949
This commit is contained in:
HJ 2024-12-31 12:13:01 +00:00
commit f6a1c4f2c2
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 }) => {