X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Frouter.js;h=599cfcb3dce5672dd2fd74207f491bedcfe7bca3;hb=dac395887d96e2d642b209c6db6aaacc3ffacb34;hp=26bdee9441fdfb34452c6f394eff187aa71adc3d;hpb=afd3240d89a2f6191fe9426960dc0c1667b40c77;p=vchess.git diff --git a/client/src/router.js b/client/src/router.js index 26bdee94..599cfcb3 100644 --- a/client/src/router.js +++ b/client/src/router.js @@ -5,7 +5,7 @@ import Hall from "./views/Hall.vue"; Vue.use(Router); function loadView(view) { - return () => import(/* webpackChunkName: "view-[request]" */ `@/views/${view}.vue`) + return () => import(/* webpackChunkName: "view-[request]" */ `@/views/${view}.vue`) } import { ajax } from "@/utils/ajax"; @@ -46,8 +46,8 @@ const router = new Router({ localStorage["myname"] = res.name; localStorage["myid"] = res.id; } - // TODO: I don't like these 2 lines, "next('/')" should be enough - window.location = "/"; + // TODO: I don't like these 2 lines, "next('/')" should be enough + window.location = "/"; next(); } ); @@ -68,7 +68,7 @@ const router = new Router({ { path: "/analyze/:vname([a-zA-Z0-9]+)", name: "analyze", - component: loadView("Game"), + component: loadView("Analyze"), }, { path: "/about", @@ -86,9 +86,6 @@ router.beforeEach((to, from, next) => { store.state.conn.send(JSON.stringify({code: "pagechange", page: to.path})); } next(); - // TODO?: redirect to current game (through GameStorage.getCurrent()) if any? - // (and if the URL doesn't already match it) (use next("/game/GID")) - //https://router.vuejs.org/guide/advanced/navigation-guards.html#global-before-guards }); export default router;