X-Git-Url: https://git.auder.net/pieces/Checkered/cq.svg?a=blobdiff_plain;f=client%2Fsrc%2Frouter.js;h=071af8c5257a7c5cac68a966ee394e833ddfcb94;hb=89021f181ac0689bbc785ce0ebd9a910e66352b0;hp=5563980b1d90c66204045afe9430ab99c881b463;hpb=a3ac374ba213c7044db6cbcfafb81d4b66a0a290;p=vchess.git diff --git a/client/src/router.js b/client/src/router.js index 5563980b..071af8c5 100644 --- a/client/src/router.js +++ b/client/src/router.js @@ -38,20 +38,25 @@ 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"), }, { - path: "/analyze/:vname([a-zA-Z0-9]+)", - name: "analyze", - component: loadView("Analyze"), + path: "/analyse/:vname([a-zA-Z0-9]+)", + name: "analyse", + component: loadView("Analyse"), }, { path: "/about", @@ -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;