fix not being able to re-enable sockets until page refresh
This commit is contained in:
parent
64fa662644
commit
48bef143d8
3 changed files with 12 additions and 1 deletions
|
@ -40,7 +40,16 @@ const api = {
|
|||
// Global MastoAPI socket control, in future should disable ALL sockets/(re)start relevant sockets
|
||||
enableMastoSockets (store) {
|
||||
const { state, dispatch } = store
|
||||
if (state.mastoUserSocket) return
|
||||
// Do not initialize unless nonexistent or closed
|
||||
if (
|
||||
state.mastoUserSocket &&
|
||||
![
|
||||
WebSocket.CLOSED,
|
||||
WebSocket.CLOSING
|
||||
].includes(state.mastoUserSocket.getState())
|
||||
) {
|
||||
return
|
||||
}
|
||||
return dispatch('startMastoUserSocket')
|
||||
},
|
||||
disableMastoSockets (store) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue