Commit d995518e authored by Adam Procter's avatar Adam Procter
Browse files

Merge branch 'main' into futurenogg

parents 026c457b 40d69b9c
import { createRouter, createWebHistory } from 'vue-router'
import Start from '../views/Start.vue'
function guardMyroute(to, from, next) {
var hasMicrocosm = false
if (localStorage.getItem('nogg_microcosm')) hasMicrocosm = true
else hasMicrocosm = false
if (hasMicrocosm) {
next() // allow to enter route
} else {
next('/') // go to '/'
}
}
const routes = [
{
path: '/',
......@@ -19,6 +30,7 @@ const routes = [
{
path: '/collect',
name: 'Collect',
beforeEnter: guardMyroute,
// route level code-splitting
// this generates a separate chunk (credits.[hash].js) for this route
// which is lazy-loaded when the route is visited.
......@@ -29,6 +41,7 @@ const routes = [
{
path: '/cards',
name: 'Cards',
beforeEnter: guardMyroute,
// route level code-splitting
// this generates a separate chunk (credits.[hash].js) for this route
// which is lazy-loaded when the route is visited.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment