diff --git a/src/components/Pagination.vue b/src/components/Pagination.vue
index 486e83e..59d8581 100644
--- a/src/components/Pagination.vue
+++ b/src/components/Pagination.vue
@@ -9,7 +9,7 @@ import throttle from 'lodash.throttle'
export default {
name: 'Pagination',
- props: ['loading', 'query-selector', 'padding-bottom', 'padding-top', 'paginate'],
+ props: ['loading', 'query-selector', 'padding-bottom', 'padding-top', 'paginate', 'wait'],
computed: {
element () {
if(this.querySelector){
@@ -48,7 +48,7 @@ export default {
}
if(scrollBottom > 0) {
- if(this.paginate) {
+ if(this.paginate && !this.wait) {
this.$emit('loadNext');
}
} else if(scrollTop > 0) {
diff --git a/src/views/Marketplace.vue b/src/views/Marketplace.vue
index 3708213..53469b6 100644
--- a/src/views/Marketplace.vue
+++ b/src/views/Marketplace.vue
@@ -41,6 +41,7 @@
v-if='items.length'
:loading='loading'
:paginate="paginate"
+ :wait="wait"
@loadNext='getItems(false)'
>
@@ -153,7 +154,8 @@ export default {
paginate: true,
offset: 0,
nextURL: null,
- category: this.$route.params.category
+ category: this.$route.params.category,
+ wait: true
}
},
methods: {
@@ -175,6 +177,9 @@ export default {
},
getItems (initial) {
this.loading = true
+ if(!initial) {
+ this.wait = true
+ }
this.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'marketplace/' + this.category + '?offset=' + this.offset)
.then(res => {
@@ -194,9 +199,11 @@ export default {
this.last = res.data.Items
}
this.loading = false
+ this.wait = false
})
.catch((e) => {
this.loading = false
+ this.wait = false
AjaxErrorHandler(this.$store)(e)
})
},
diff --git a/src/views/Users.vue b/src/views/Users.vue
index d077453..2a37bfb 100644
--- a/src/views/Users.vue
+++ b/src/views/Users.vue
@@ -7,11 +7,11 @@
@@ -113,7 +113,8 @@ export default {
offset: 0,
paginate: true,
limit: 30,
- loading: true
+ loading: true,
+ wait: true
}
},
methods: {
@@ -124,6 +125,9 @@ export default {
this.offset = 0
this.paginate = true
}
+ if(!initial) {
+ this.wait = true
+ }
this.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'user/' + '?offset=' + this.offset)
.then(res => {
@@ -141,9 +145,11 @@ export default {
this.users.push(...res.data)
}
this.loading = false
+ this.wait = false
})
.catch((e) => {
this.loading = false
+ this.wait = false
AjaxErrorHandler(this.$store)(e)
})
}