File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,11 +83,6 @@ export default {
8383 required: false ,
8484 },
8585 },
86- data () {
87- return {
88-
89- }
90- },
9186 computed: {
9287 attachments () {
9388 return [... this .$store .getters .attachmentsByCard (this .cardId )].sort ((a , b ) => b .id - a .id )
Original file line number Diff line number Diff line change @@ -114,6 +114,11 @@ export default {
114114 return this .card .id
115115 },
116116 },
117+ watch: {
118+ card (newCard ) {
119+ this .$store .dispatch (' fetchAttachments' , newCard .id )
120+ },
121+ },
117122 created : function () {
118123 this .$store .dispatch (' fetchAttachments' , this .card .id )
119124 },
Original file line number Diff line number Diff line change @@ -48,11 +48,7 @@ export default {
4848 } ,
4949
5050 createAttachments ( state , { cardId, attachments } ) {
51- if ( typeof state . attachments [ cardId ] === 'undefined' ) {
52- Vue . set ( state . attachments , cardId , attachments )
53- } else {
54- state . attachments [ cardId ] . push ( attachments )
55- }
51+ Vue . set ( state . attachments , cardId , attachments )
5652 } ,
5753
5854 updateAttachment ( state , { cardId, attachment } ) {
You can’t perform that action at this time.
0 commit comments