diff --git a/examples/vector/index.js b/examples/vector/index.js index b601cfce..64e517ca 100644 --- a/examples/vector/index.js +++ b/examples/vector/index.js @@ -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( , document.getElementById('matrixchat') ); + +window.addEventListener('hashchange', onHashChange); +window.onload = function() { + routeUrl(window.location); + loaded = true; +} +