mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
disconnect websockets on logout
This commit is contained in:
parent
8ab696d346
commit
e1a9a9ef5b
@ -408,7 +408,10 @@ class ComtyApp extends React.Component {
|
||||
app.eventBus.emit("layout.animations.fadeIn")
|
||||
},
|
||||
"auth:logout_success": async () => {
|
||||
app.cores.api.disconnectWebsockets()
|
||||
|
||||
app.navigation.goAuth()
|
||||
|
||||
await this.flushState()
|
||||
},
|
||||
"session.invalid": async (error) => {
|
||||
|
@ -5,7 +5,7 @@ import createClient from "comty.js"
|
||||
import measurePing from "comty.js/handlers/measurePing"
|
||||
import request from "comty.js/handlers/request"
|
||||
import useRequest from "comty.js/hooks/useRequest"
|
||||
import { reconnectWebsockets } from "comty.js"
|
||||
import { reconnectWebsockets, disconnectWebsockets } from "comty.js"
|
||||
|
||||
export default class APICore extends Core {
|
||||
static namespace = "api"
|
||||
@ -25,6 +25,7 @@ export default class APICore extends Core {
|
||||
measurePing: measurePing,
|
||||
useRequest: useRequest,
|
||||
reconnectWebsockets: reconnectWebsockets,
|
||||
disconnectWebsockets: disconnectWebsockets,
|
||||
}
|
||||
|
||||
listenEvent(key, handler, instance) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user