Skip to content

Commit 481dc7c

Browse files
authored
Merge pull request #13708 from abhinavohri/fix/list-layout-load-more
fix(ui): load messages when list cannot scroll
2 parents 559727a + 1e5f733 commit 481dc7c

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/components/Mailbox.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ export default {
244244
245245
async loadEnvelopes() {
246246
logger.debug(`Fetching envelopes for folder ${this.mailbox.databaseId} (${this.searchQuery})`, this.mailbox)
247+
this.endReached = false
247248
if (!this.syncedMailboxes.has(this.mailbox.databaseId + (this.searchQuery ?? ''))) {
248249
// Only trigger skeleton if we didn't sync envelopes yet
249250
this.loadingEnvelopes = true
@@ -297,6 +298,10 @@ export default {
297298
},
298299
299300
async loadMore() {
301+
if (!this.hasMessages || this.loadingEnvelopes || this.loadingMore || this.endReached || this.error) {
302+
return
303+
}
304+
300305
if (!this.expanded && this.envelopesToShow.length < this.envelopes.length) {
301306
logger.debug('expanding envelope list')
302307
this.expanded = true

src/directives/infinite-scroll.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,21 @@ function onUnbind(el) {
211211
}
212212
}
213213

214+
function onUpdate(el) {
215+
nextTick(() => {
216+
if (el?.[ctx]?.binded) {
217+
el[ctx].scrollListener()
218+
}
219+
})
220+
}
221+
214222
export default {
215223
// Vue 2
216224
bind: onBind,
225+
componentUpdated: onUpdate,
217226
unbind: onUnbind,
218227
// Vue 3
219228
mounted: onBind,
229+
updated: onUpdate,
220230
unmounted: onUnbind,
221231
}

0 commit comments

Comments
 (0)