fix set locations on events

This commit is contained in:
srgooglo 2022-06-01 20:19:02 +02:00
parent 9f3a538492
commit 0fa964414b

View File

@ -95,18 +95,13 @@ class App extends React.Component {
"new_session": async () => { "new_session": async () => {
await this.flushState() await this.flushState()
await this.initialization() await this.initialization()
if (window.location.pathname == "/login") {
window.app.setLocation(this.beforeLoginLocation ?? "/main")
this.beforeLoginLocation = null
}
}, },
"destroyed_session": async () => { "destroyed_session": async () => {
await this.flushState() await this.flushState()
app.eventBus.emit("forceToLogin") app.eventBus.emit("forceToLogin")
}, },
"forceToLogin": () => { "forceToLogin": () => {
app.setLocation("/main") window.app.setLocation("/main")
app.eventBus.emit("app.createLogin") app.eventBus.emit("app.createLogin")
}, },
"invalid_session": async (error) => { "invalid_session": async (error) => {