mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24: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 () => {
|
"session.logout": async () => {
|
||||||
await this.sessionController.logout()
|
await this.sessionController.logout()
|
||||||
},
|
},
|
||||||
"new_session": async () => {
|
"session.created": async () => {
|
||||||
await this.flushState()
|
await this.flushState()
|
||||||
await this.initialization()
|
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) => {
|
await Promise.tasked(initializationTasks).catch((reason) => {
|
||||||
|
@ -46,7 +46,7 @@ export default class Session {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Session.token = token
|
Session.token = token
|
||||||
window.app.eventBus.emit("new_session")
|
window.app.eventBus.emit("session.created")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user