diff options
Diffstat (limited to 'src/store/getters.js')
-rw-r--r-- | src/store/getters.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/store/getters.js b/src/store/getters.js index 9e4e59518..6d5204fd6 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -19,7 +19,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -import { defaultTo, head, sortBy, prop } from 'ramda' +import { defaultTo, head, prop, sortBy } from 'ramda' import { UNIFIED_ACCOUNT_ID } from './constants' import { normalizedEnvelopeListId } from './normalization' @@ -70,6 +70,12 @@ export const getters = { const list = getters.getMailbox(mailboxId).envelopeLists[normalizedEnvelopeListId(query)] || [] return list.map((msgId) => state.envelopes[msgId]) }, + getEnvelopesByThreadRootId: (state) => (accountId, threadRootId) => { + return sortBy( + prop('dateInt'), + Object.values(state.envelopes).filter(envelope => envelope.accountId === accountId && envelope.threadRootId === threadRootId) + ) + }, getMessage: (state) => (id) => { return state.messages[id] }, |