Skip to content
Snippets Groups Projects
Commit daf26655 authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

fjernet et "race condition" ifm. lasting av entiteter

parent ae596587
No related branches found
No related tags found
No related merge requests found
......@@ -130,14 +130,13 @@ export default {
search_results: [],
lang: 'bob,nob',
waiting_for_articles: true,
waiting_for_bob_metadata: true,
waiting_for_nob_metadata: true,
waiting_for_metadata: true,
article: {lemmas: [], body:{pronunciation: [], definitions: [], etymology: []}}
}
},
computed: {
waiting: function() {
return this.waiting_for_articles || this.waiting_for_bob_metadata || this.waiting_for_nob_metadata
return this.waiting_for_articles || this.waiting_for_metadata
},
api_pref: function() {
return api_endpoint + '/' + this.lang + '/article/'
......@@ -203,30 +202,30 @@ export default {
},
mounted: function(){
let self = this
axios.get(api_endpoint + '/bob').then(function(response){
let concepts = response.data.concepts
entities.bob = concepts
self.waiting_for_bob_metadata = false
})
axios.get(api_endpoint + '/nob').then(function(response){
let concepts = response.data.concepts
entities.nob = concepts
self.waiting_for_nob_metadata = false
})
this.lang = 'bob,nob'
if(this.$route.name == 'word') {
navigate_to_word(this, this.$route.params.word)
}
else if(this.$route.name == 'lookup'){
navigate_to_article(this, this.$route.params.id)
}
else {
this.waiting_for_articles = false
history.replaceState({article: this.article, search_results: this.search_results, lang: this.lang}, '')
}
Promise.all([
axios.get(api_endpoint + '/bob').then(function(response){
let concepts = response.data.concepts
entities.bob = concepts
}),
axios.get(api_endpoint + '/nob').then(function(response){
let concepts = response.data.concepts
entities.nob = concepts
})
]).then(function(_) {
self.waiting_for_metadata = false
if(self.$route.name == 'word') {
navigate_to_word(self, self.$route.params.word)
}
else if(self.$route.name == 'lookup'){
navigate_to_article(self, self.$route.params.id)
}
else {
self.waiting_for_articles = false
history.replaceState({article: self.article, search_results: self.search_results, lang: self.lang}, '')
}
})
}
}
</script>
......
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