diff options
Diffstat (limited to 'src/store/actions.js')
-rw-r--r-- | src/store/actions.js | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/store/actions.js b/src/store/actions.js index c62bd8c4c..ee3d99032 100644 --- a/src/store/actions.js +++ b/src/store/actions.js @@ -81,6 +81,7 @@ import { wait } from '../util/wait' import { updateAccount as updateSieveAccount } from '../service/SieveService' import { PAGE_SIZE, UNIFIED_INBOX_ID } from './constants' import * as ThreadService from '../service/ThreadService' +import { getPrioritySearchQueries } from '../util/priorityInbox' const sliceToPage = slice(0, PAGE_SIZE) @@ -461,22 +462,26 @@ export default { ) } else if (mailbox.isPriorityInbox && query === undefined) { return Promise.all( - getters.accounts - .filter((account) => !account.isUnified) - .map((account) => - Promise.all( - getters - .getMailboxes(account.id) - .filter((mb) => mb.specialRole === mailbox.specialRole) - .map((mailbox) => - dispatch('syncEnvelopes', { - mailboxId: mailbox.databaseId, - query, - init, - }) + getPrioritySearchQueries().map((query) => { + return Promise.all( + getters.accounts + .filter((account) => !account.isUnified) + .map((account) => + Promise.all( + getters + .getMailboxes(account.id) + .filter((mb) => mb.specialRole === mailbox.specialRole) + .map((mailbox) => + dispatch('syncEnvelopes', { + mailboxId: mailbox.databaseId, + query, + init, + }) + ) ) - ) + ) ) + }) ) } |