Skip to content

Commit

Permalink
fix: thread disappearing after refresh
Browse files Browse the repository at this point in the history
Signed-off-by: greta <[email protected]>
  • Loading branch information
GretaD committed Oct 11, 2024
1 parent b6f3726 commit fe12a29
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 fe12a29

Please sign in to comment.