mirror of
https://github.com/HabitRPG/habitica.git
synced 2026-04-23 13:49:22 -05:00
Added page increment when page is loaded to prevent scroll stopping (#9573)
This commit is contained in:
@@ -137,6 +137,7 @@ export default {
|
||||
|
||||
// Reset the page when filters are updated
|
||||
this.lastPageLoaded = 0;
|
||||
this.hasLoadedAllGuilds = false;
|
||||
this.queryFilters.page = this.lastPageLoaded;
|
||||
|
||||
this.queryFilters.categories = eventData.categories.join(',');
|
||||
@@ -173,10 +174,11 @@ export default {
|
||||
},
|
||||
async fetchGuilds () {
|
||||
// We have the data cached
|
||||
if (this.lastPageLoaded === 0 && this.guilds.length > 0) return;
|
||||
if (this.lastPageLoaded === 0 && this.guilds.length > 0) {
|
||||
this.lastPageLoaded += 1;
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
|
||||
this.queryFilters.page = this.lastPageLoaded;
|
||||
let guilds = await this.$store.dispatch('guilds:getPublicGuilds', this.queryFilters);
|
||||
if (guilds.length === 0) this.hasLoadedAllGuilds = true;
|
||||
|
||||
Reference in New Issue
Block a user