From fe12a29439c2b3c376819b27d44a034ad8cc2fb6 Mon Sep 17 00:00:00 2001 From: greta Date: Mon, 2 Sep 2024 12:17:06 +0200 Subject: [PATCH] fix: thread disappearing after refresh Signed-off-by: greta --- src/components/MailboxThread.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/components/MailboxThread.vue b/src/components/MailboxThread.vue index e9c9b24533..3fce095611 100644 --- a/src/components/MailboxThread.vue +++ b/src/components/MailboxThread.vue @@ -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) { @@ -298,6 +300,7 @@ export default { mailbox() { clearTimeout(this.startMailboxTimer) setTimeout(this.saveStartMailbox, START_MAILBOX_DEBOUNCE) + this.fetchEnvelopes() }, }, created() { @@ -305,11 +308,23 @@ export default { }, 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')