diff --git a/src/components/DictionaryView.vue b/src/components/DictionaryView.vue index 22410b2074fb7a678b83c204db9d822e5a869580..5124f34f00d6a1fcbc0922b248f211de5edc8aa8 100644 --- a/src/components/DictionaryView.vue +++ b/src/components/DictionaryView.vue @@ -159,18 +159,17 @@ function navigate_to_search(self, query) { function load_articles(self, query, offset, n, dict) { let article_IDs = self.article_info.articles[dict] + if (article_IDs) + { if (offset > article_IDs.length) { n = 0 } else if (offset + n > article_IDs.length) { n = n + (article_IDs.length - n) } - console.log("n, offset", n, offset) if (n > 0 && (self.lang == dict || self.lang == "bm,nn")) { article_IDs = article_IDs.slice(offset, offset + n) - console.log("ARTICLES",dict, article_IDs) - console.log("OFFSET offset+N", offset, offset+n) return Promise.all(article_IDs.map((article_id) => { return axios.get(`${ARTICLE_ENDPOINT}${dict}/article/${article_id}.json`) @@ -217,11 +216,8 @@ function load_articles(self, query, offset, n, dict) { self.connection_error(error) }) } - else { - return Promise.resolve() } - - + return Promise.resolve() } @@ -251,7 +247,10 @@ function navigate_to_query(self, word) { }) }).catch(error =>{ + console.log(error) + self.waiting_for_articles = false self.connection_error(error) + }) } @@ -436,7 +435,7 @@ export default { console.log("MAX", this.max_scroll) let offset = 10 * this.page this.page += 1 - if (!this.waiting_for_articles) { + if (!self.waiting_for_articles) { self.waiting_for_articles = true console.log("PARAMS", this.query.q, offset, 10) Promise.all([