mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
improve sessions.created
behavior
This commit is contained in:
parent
0726833e9b
commit
f43a20548e
@ -92,7 +92,7 @@ class App extends React.Component {
|
||||
"session.logout": async () => {
|
||||
await this.sessionController.logout()
|
||||
},
|
||||
"new_session": async () => {
|
||||
"session.created": async () => {
|
||||
await this.flushState()
|
||||
await this.initialization()
|
||||
},
|
||||
@ -380,6 +380,12 @@ class App extends React.Component {
|
||||
}
|
||||
}
|
||||
},
|
||||
() => {
|
||||
// if is `/login` move to `/`
|
||||
if (window.location.pathname === "/login") {
|
||||
app.setLocation("/")
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
await Promise.tasked(initializationTasks).catch((reason) => {
|
||||
|
@ -46,7 +46,7 @@ export default class Session {
|
||||
}
|
||||
|
||||
Session.token = token
|
||||
window.app.eventBus.emit("new_session")
|
||||
window.app.eventBus.emit("session.created")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user