diff options
author | Richard Steinmetz <richard@steinmetz.cloud> | 2021-03-30 12:06:02 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-04-09 15:33:54 +0300 |
commit | d4e4817e92602b9c973dac1a36080dc40cafdb56 (patch) | |
tree | a49e06b84e7c5447babf235eb338bffdb39317cc /src/store/getters.js | |
parent | 578463d48edb111881ba268eeb8395d147842a30 (diff) |
Normalize envelope tags in vuex store
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Diffstat (limited to 'src/store/getters.js')
-rw-r--r-- | src/store/getters.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/store/getters.js b/src/store/getters.js index 3b75c5699..611b0f96a 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -69,4 +69,11 @@ export const getters = { const envelopes = thread.map(id => state.envelopes[id]) return sortBy(prop('dateInt'), envelopes) }, + getEnvelopeTags: (state) => (id) => { + const tags = state.envelopes[id]?.tags ?? [] + return tags.map((tagId) => state.tags[tagId]) + }, + getTag: (state) => (id) => { + return state.tags[id] + }, } |