Skip to content

Commit

Permalink
Merge pull request #10084 from nextcloud/fix/thread-disappearing-list…
Browse files Browse the repository at this point in the history
…view

fix: thread disappearing after refresh
  • Loading branch information
GretaD authored Oct 11, 2024
2 parents 1fddfe9 + fe12a29 commit 73294c6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/components/MailboxThread.vue
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ export default {
this.handleMailto()
if (to.name === 'mailbox' && to.params.mailboxId === PRIORITY_INBOX_ID) {
await this.onPriorityMailboxOpened()
} else if (this.isThreadShown) {
await this.fetchEnvelopes()
}
},
async hasFollowUpEnvelopes(value) {
Expand All @@ -298,18 +300,31 @@ export default {
mailbox() {
clearTimeout(this.startMailboxTimer)
setTimeout(this.saveStartMailbox, START_MAILBOX_DEBOUNCE)
this.fetchEnvelopes()
},
},
created() {
this.handleMailto()
},
async mounted() {
setTimeout(this.saveStartMailbox, START_MAILBOX_DEBOUNCE)
if (this.isThreadShown) {
await this.fetchEnvelopes()
}
},
beforeUnmount() {
clearTimeout(this.startMailboxTimer)
},
methods: {
async fetchEnvelopes() {
const existingEnvelopes = this.$store.getters.getEnvelopes(this.mailbox.databaseId, this.searchQuery || '')
if (!existingEnvelopes.length) {
await this.$store.dispatch('fetchEnvelopes', {
mailboxId: this.mailbox.databaseId,
query: this.searchQuery || '',
})
}
},
async onPriorityMailboxOpened() {
logger.debug('Priority inbox was opened')
Expand Down

0 comments on commit 73294c6

Please sign in to comment.