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 <gretadoci@gmail.com>

[skip ci]
  • Loading branch information
GretaD committed Nov 20, 2024
1 parent 4ef193f commit 6116863
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/components/MailboxThread.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,38 @@ export default {
watch: {
$route() {
this.handleMailto()
if (this.isThreadShown) {
this.fetchEnvelopes()
}
},
mailbox() {
clearTimeout(this.startMailboxTimer)
setTimeout(this.saveStartMailbox, START_MAILBOX_DEBOUNCE)
this.fetchEnvelopes()
},
},
created() {
this.handleMailto()
},
mounted() {
setTimeout(this.saveStartMailbox, START_MAILBOX_DEBOUNCE)
if (this.isThreadShown) {
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 || '',
})
}
},
deleteMessage(id) {
this.bus.emit('delete', id)
},
Expand Down

0 comments on commit 6116863

Please sign in to comment.