Move all caching to helper

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2022-05-06 11:32:59 +02:00
parent ed3be361b5
commit 03f400620e
7 changed files with 111 additions and 223 deletions

View File

@@ -252,6 +252,12 @@ export default {
}
Vue.set(state.cards[existingIndex], 'lastModified', Date.now() / 1000)
},
cardSetAttachmentCount(state, { cardId, count }) {
const existingIndex = state.cards.findIndex(_card => _card.id === cardId)
if (existingIndex !== -1) {
Vue.set(state.cards[existingIndex], 'attachmentCount', count)
}
},
cardIncreaseAttachmentCount(state, cardId) {
const existingIndex = state.cards.findIndex(_card => _card.id === cardId)
if (existingIndex !== -1) {