Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
fixed issue with catalog not being fetched properly also removed some…
Browse files Browse the repository at this point in the history
… JS fuckery
  • Loading branch information
n4n0GH committed Aug 31, 2019
1 parent cfe5c8e commit ceb096c
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 40 deletions.
4 changes: 2 additions & 2 deletions src/components/board/Pages.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div>
<div class="container-fluid">
<div class="row">
<div class="col-12 text-center">
<new-template v-if="openNew"/> <!-- supply slots in case of reply instead of new thread -->
Expand All @@ -8,7 +8,7 @@
<div class="row text-mono text-left">
<div class="col-12">
<router-link tag="span" :to="{name: 'index'}">[<a>home</a>]</router-link>
<router-link tag="span" :to="{path: 'catalog'}">[<a>catalog</a>]</router-link>
<router-link tag="span" :to="{name: 'catalog'}">[<a>catalog</a>]</router-link>
</div>
</div>
</div>
Expand Down
9 changes: 3 additions & 6 deletions src/components/board/Single.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,9 @@
},
updated(){
this.componentKey = Math.floor(Math.random()*10)
if(this.$route.params.ticker && this.$route.path != 'catalog' && !this.$route.params.page && !this.$route.params.number){
this.$router.push({
path: this.board+'/1'
})
}
console.log(this.$route.params)
}
}
</script>
43 changes: 18 additions & 25 deletions src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,24 @@ export default new Router({
component: Index
},
{
path: '/board', // grab board identifier
name: 'board',
component: () => import(/* webpackChunkName: "board" */ './views/Board.vue'),
path: '/board/:ticker',
name: 'ticker',
component: () => import(/* webpackChunkName: "ticker" */ './components/board/Single.vue'),
children: [
{
path: ':ticker',
name: 'ticker',
component: () => import(/* webpackChunkName: "ticker" */ './components/board/Single.vue'),
children: [
{
path: 'catalog',
name: 'catalog',
component: () => import(/* webpackChunkName: "catalog" */ './views/Catalog.vue')
},
{
path: ':page', // grab page identifier
name: 'page',
component: () => import(/* webpackChunkName: "page" */ './components/board/Pages.vue')
},
{
path: 'thread/:number', // grab thread identifier
name: 'thread',
component: () => import(/* webpackChunkName: "thread" */ './views/Thread.vue')
}
]
path: 'catalog',
name: 'catalog',
component: () => import(/* webpackChunkName: "catalog" */ './views/Catalog.vue')
},
{
path: ':page?', // grab page identifier
name: 'page',
component: () => import(/* webpackChunkName: "page" */ './components/board/Pages.vue')
},
{
path: 'thread/:number', // grab thread identifier
name: 'thread',
component: () => import(/* webpackChunkName: "thread" */ './views/Thread.vue')
}
]
},
Expand All @@ -53,11 +46,11 @@ export default new Router({
name: 'error',
component: () => import(/* webpackChunkName: "error" */ './views/Error.vue')
},
/*{
{
path: '*',
name: 'catchErr',
redirect: '/no-bueno'
}*/
}
],
scrollBehavior (to, from, savedPosition) {
if (savedPosition) {
Expand Down
14 changes: 13 additions & 1 deletion src/views/Board.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,17 @@
</template>

<script>
export default {
beforeUpdate(){
console.log(this.$route.params)
if(this.$route.params.length == 1){
console.log('yes')
}
if(this.$route.params.ticker && !this.$route.params.page && !this.$route.params.number && !this.$route.params.catalog){
this.$router.push({
path: this.$route.params.ticker+'/1'
})
}
}
}
</script>
6 changes: 0 additions & 6 deletions src/views/Catalog.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<template>
<div>dick</div>
</template>

<script>
export default{
}
</script>

0 comments on commit ceb096c

Please sign in to comment.