Skip to content
Snippets Groups Projects
Commit 099e37d6 authored by Henrik Askjer's avatar Henrik Askjer
Browse files

fix welcome page routing bugs

parent 41288fa3
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@
<Article :key="article_key" :article="article" @article-click="article_link_click" />
</div>
<div class="welcome" v-if="! (article || error || total_results() || waiting)">
<div class="welcome" v-if="!(article || error || $route.name || waiting)">
<div class="monthly" :class="$vuetify.breakpoint.name">
<div>
<Article :article="monthly_bm" @article-click="article_link_click" />
......@@ -307,7 +307,18 @@ export default {
return total
}
},
load_monthly_bm: function() {
let self = this
axios.get(ARTICLE_ENDPOINT + 'bm/article/5607.json').then(function(response){
self.monthly_bm = Object.assign(response.data, {dictionary: 'bm'})
})
},
load_monthly_nn: function() {
let self = this
axios.get(ARTICLE_ENDPOINT + 'nn/article/78569.json').then(function(response){
self.monthly_nn = Object.assign(response.data, {dictionary: 'nn'})
})
},
error_message: function(error) {
this.search_results = {}
console.log(error)
......@@ -520,15 +531,8 @@ export default {
selected: self.selected,
inflection_suggestions: self.inflection_suggestions}, '')
// words of the month
axios.get(ARTICLE_ENDPOINT + 'bm/article/5607.json').then(function(response){
self.monthly_bm = Object.assign(response.data, {dictionary: 'bm'})
})
axios.get(ARTICLE_ENDPOINT + 'nn/article/78569.json').then(function(response){
self.monthly_nn = Object.assign(response.data, {dictionary: 'nn'})
})
self.load_monthly_bm()
self.load_monthly_nn()
}
}).catch(function(error){
......@@ -539,7 +543,18 @@ export default {
self.waiting_for_articles = false
})
},
watch: {
$route(to, from) {
console.log("TO", to)
console.log("FROM", from)
if (!to.name) {
this.load_monthly_bm()
this.load_monthly_nn()
}
}
},
created: function() {
console.log("CREATED")
let self = this
window.onpopstate = function (event) {
if (event.state) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment