X-Git-Url: https://git.auder.net/game/%22%20%20%20data.gameInfo.gameId%20%20%20%22?a=blobdiff_plain;f=client%2Fsrc%2Frouter.js;h=071af8c5257a7c5cac68a966ee394e833ddfcb94;hb=89021f181ac0689bbc785ce0ebd9a910e66352b0;hp=daa9619dcdd0d0aa7ab001b4b28dd40b9080cc60;hpb=677fe285f1137d1d3e672dcf2dae3ac6e943be37;p=vchess.git diff --git a/client/src/router.js b/client/src/router.js index daa9619d..071af8c5 100644 --- a/client/src/router.js +++ b/client/src/router.js @@ -38,13 +38,18 @@ const router = new Router({ name: "logout", component: loadView("Logout"), }, + { + path: "/problems", + name: "myproblems", + component: loadView("Problems"), + }, { path: "/mygames", name: "mygames", component: loadView("MyGames"), }, { - path: "/game/:id", + path: "/game/:id([a-zA-Z0-9]+)", name: "game", component: loadView("Game"), }, @@ -61,14 +66,4 @@ const router = new Router({ ] }); -router.beforeEach((to, from, next) => { - window.scrollTo(0, 0); - if (!!store.state.conn) //uninitialized at first page - { - // Notify WebSockets server (TODO: path or fullPath?) - store.state.conn.send(JSON.stringify({code: "pagechange", page: to.path})); - } - next(); -}); - export default router;