People: Disable loadMore() and refresh() while tab is inactive #22

This commit is contained in:
Michael Mayer 2021-09-30 14:19:00 +02:00
parent 582a330837
commit 46a25548c4
2 changed files with 16 additions and 4 deletions

View file

@ -373,7 +373,9 @@ export default {
this.lastId = "";
},
loadMore() {
if (this.scrollDisabled) return;
if (this.scrollDisabled || !this.active) {
return;
}
this.scrollDisabled = true;
this.listen = false;
@ -456,11 +458,15 @@ export default {
return params;
},
refresh() {
if (this.loading) return;
if (this.loading || !this.active) {
return;
}
this.loading = true;
this.page = 0;
this.dirty = true;
this.scrollDisabled = false;
this.loadMore();
},
search() {

View file

@ -420,7 +420,9 @@ export default {
this.lastId = "";
},
loadMore() {
if (this.scrollDisabled) return;
if (this.scrollDisabled || !this.active) {
return;
}
this.scrollDisabled = true;
this.listen = false;
@ -503,11 +505,15 @@ export default {
return params;
},
refresh() {
if (this.loading) return;
if (this.loading || !this.active) {
return;
}
this.loading = true;
this.page = 0;
this.dirty = true;
this.scrollDisabled = false;
this.loadMore();
},
search() {