Fix attachments being added mutliple times
This commit is contained in:
@ -7,15 +7,18 @@ export default {
|
||||
}),
|
||||
mutations: {
|
||||
set(state, attachments) {
|
||||
console.debug('Set attachments', attachments)
|
||||
Vue.set(state, 'attachments', attachments)
|
||||
},
|
||||
add(state, attachment) {
|
||||
console.debug('Add attachement', attachment)
|
||||
state.attachments.push(attachment)
|
||||
},
|
||||
removeById(state, id) {
|
||||
for (const a in state.attachments) {
|
||||
if (state.attachments[a].id === id) {
|
||||
state.attachments.splice(a, 1)
|
||||
console.debug('Remove attachement', id)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user