mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 03:36:07 +03:00
Set up URL routing after creating matrixchat in case onload / hashchange gets called before
This commit is contained in:
parent
9f98c4e9f7
commit
69ac0bd368
1 changed files with 7 additions and 7 deletions
|
@ -49,15 +49,8 @@ function onHashChange(ev) {
|
|||
routeUrl(window.location);
|
||||
}
|
||||
|
||||
window.addEventListener('hashchange', onHashChange);
|
||||
|
||||
var loaded = false;
|
||||
|
||||
window.onload = function() {
|
||||
routeUrl(window.location);
|
||||
loaded = true;
|
||||
}
|
||||
|
||||
// This will be called whenever the SDK changes screens,
|
||||
// so a web page can update the URL bar appropriately.
|
||||
var onNewScreen = function(screen) {
|
||||
|
@ -81,3 +74,10 @@ window.matrixChat = React.render(
|
|||
<MatrixReactSdk.MatrixChat onNewScreen={onNewScreen} registrationUrl={makeRegistrationUrl()} />,
|
||||
document.getElementById('matrixchat')
|
||||
);
|
||||
|
||||
window.addEventListener('hashchange', onHashChange);
|
||||
window.onload = function() {
|
||||
routeUrl(window.location);
|
||||
loaded = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue