mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
fix events
This commit is contained in:
parent
f7a9635c72
commit
663029066b
@ -76,7 +76,7 @@ class App extends React.Component {
|
||||
window.app.version = config.package.version
|
||||
}
|
||||
|
||||
publicEvents = {
|
||||
static publicEvents = {
|
||||
"clearAllOverlays": function () {
|
||||
window.app.DrawerController.closeAll()
|
||||
},
|
||||
@ -111,13 +111,15 @@ class App extends React.Component {
|
||||
app.eventBus.emit("app.createLogin")
|
||||
},
|
||||
"invalid_session": async (error) => {
|
||||
if (!this.state.session) {
|
||||
const token = await Session.token
|
||||
|
||||
if (!this.state.session && !token) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
await this.sessionController.forgetLocalSession()
|
||||
await this.flushState()
|
||||
|
||||
|
||||
app.eventBus.emit("forceToLogin")
|
||||
|
||||
antd.notification.open({
|
||||
@ -130,6 +132,9 @@ class App extends React.Component {
|
||||
icon: <Icons.MdOutlineAccessTimeFilled />,
|
||||
})
|
||||
},
|
||||
"no_session": async () => {
|
||||
app.eventBus.emit("forceToLogin")
|
||||
},
|
||||
"websocket_connected": () => {
|
||||
if (this.wsReconnecting) {
|
||||
this.wsReconnectingTry = 0
|
||||
@ -380,7 +385,7 @@ class App extends React.Component {
|
||||
const token = await Session.token
|
||||
|
||||
if (!token || token == null) {
|
||||
window.app.eventBus.emit("forceToLogin")
|
||||
window.app.eventBus.emit("no_session")
|
||||
return false
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user