mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Set up URL routing after creating matrixchat in case onload / hashchange gets called before
This commit is contained in:
parent
9f98c4e9f7
commit
69ac0bd368
@ -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 New Issue
Block a user