From de721ce0901de86692c75b1e725ad5513682646a Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Sun, 10 Jul 2022 12:11:39 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20don't=20open=20fi?= =?UTF-8?q?rst=20mail=20by=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonas Sulzer --- src/components/Mailbox.vue | 53 ---------------------------- src/components/MailboxThread.vue | 1 - src/components/NoMessageSelected.vue | 14 +++++++- 3 files changed, 13 insertions(+), 55 deletions(-) diff --git a/src/components/Mailbox.vue b/src/components/Mailbox.vue index ea095509ee..a8685c46fe 100644 --- a/src/components/Mailbox.vue +++ b/src/components/Mailbox.vue @@ -97,10 +97,6 @@ export default { type: Number, default: 20, }, - openFirst: { - type: Boolean, - default: true, - }, searchQuery: { type: String, required: false, @@ -142,27 +138,6 @@ export default { }, }, watch: { - // Force the envelope list to re-render when user clicks on the folder it's currently in - $route(to) { - if (to.params.threadId === undefined && !this.isMobile) { - const first = this.envelopes[0] - if (typeof first !== 'undefined') { - logger.debug('refreshing mailbox') - if (this.$route.params.mailboxId === this.account.draftsMailboxId) { - // Don't navigate - } else { - this.$router.replace({ - name: 'message', - params: { - mailboxId: this.$route.params.mailboxId, - filter: this.$route.params.filter ? this.$route.params.filter : undefined, - threadId: first.databaseId, - }, - }) - } - } - } - }, account() { this.loadEnvelopes() }, @@ -227,34 +202,6 @@ export default { logger.debug(envelopes.length + ' envelopes fetched', { envelopes }) this.loadingEnvelopes = false - if (this.openFirst && !this.isMobile && this.$route.name !== 'message' && envelopes.length > 0) { - // Show first message - const first = envelopes[0] - - // Keep the selected account-mailbox combination, but navigate to the message - // (it's not a bug that we don't use first.accountId and first.mailboxId here) - logger.debug('showing the first message of mailbox ' + this.$route.params.mailboxId) - if (this.$route.params.mailboxId === this.account.draftsMailboxId) { - this.$router.replace({ - name: 'message', - params: { - mailboxId: this.$route.params.mailboxId, - filter: this.$route.params.filter ? this.$route.params.filter : undefined, - threadId: 'new', - draftId: first.databaseId, - }, - }) - } else { - this.$router.replace({ - name: 'message', - params: { - mailboxId: this.$route.params.mailboxId, - filter: this.$route.params.filter ? this.$route.params.filter : undefined, - threadId: first.databaseId, - }, - }) - } - } } catch (error) { await matchError(error, { [MailboxLockedError.getName()]: async (error) => { diff --git a/src/components/MailboxThread.vue b/src/components/MailboxThread.vue index c3a9fd7bdf..1af7f003f5 100644 --- a/src/components/MailboxThread.vue +++ b/src/components/MailboxThread.vue @@ -57,7 +57,6 @@ class="nameother" :account="unifiedAccount" :mailbox="unifiedInbox" - :open-first="false" :search-query="appendToSearch(priorityOtherQuery)" :is-priority-inbox="true" :bus="bus" /> diff --git a/src/components/NoMessageSelected.vue b/src/components/NoMessageSelected.vue index dd156ba5dc..b63ae65d5a 100644 --- a/src/components/NoMessageSelected.vue +++ b/src/components/NoMessageSelected.vue @@ -22,24 +22,36 @@ + From bc97990766c8b006f0f90a73b18d0b3bf10d0ec6 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Thu, 14 Jul 2022 20:03:53 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20'no=20message=20selec?= =?UTF-8?q?ted'=20message=20only=20displayed=20after=2030=20seconds=20on?= =?UTF-8?q?=20priority=20inbox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonas Sulzer --- src/components/MailboxThread.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/MailboxThread.vue b/src/components/MailboxThread.vue index 1af7f003f5..0730ae5e1e 100644 --- a/src/components/MailboxThread.vue +++ b/src/components/MailboxThread.vue @@ -147,6 +147,10 @@ export default { return this.$store.getters.getMailbox(UNIFIED_INBOX_ID) }, hasEnvelopes() { + if (this.mailbox.isPriorityInbox) { + return this.$store.getters.getEnvelopes(this.mailbox.databaseId, this.appendToSearch(priorityImportantQuery)).length > 0 + || this.$store.getters.getEnvelopes(this.mailbox.databaseId, this.appendToSearch(priorityOtherQuery)).length > 0 + } return this.$store.getters.getEnvelopes(this.mailbox.databaseId, this.searchQuery).length > 0 }, hasImportantEnvelopes() { @@ -167,7 +171,7 @@ export default { query() { if (this.$route.params.filter === 'starred') { if (this.searchQuery) { - return this.searchQuery + ' is:starred' + return this.appendToSearch('is:starred') } return 'is:starred' }