|
@@ -60,7 +60,13 @@ Template.cardAttachmentsPopup.events({
|
|
file.boardId = card.boardId;
|
|
file.boardId = card.boardId;
|
|
file.cardId = card._id;
|
|
file.cardId = card._id;
|
|
file.userId = Meteor.userId();
|
|
file.userId = Meteor.userId();
|
|
- Attachments.insert(file);
|
|
|
|
|
|
+
|
|
|
|
+ const attachment = Attachments.insert(file);
|
|
|
|
+
|
|
|
|
+ if (attachment && attachment._id && attachment.isImage()) {
|
|
|
|
+ card.setCover(attachment._id);
|
|
|
|
+ }
|
|
|
|
+
|
|
Popup.close();
|
|
Popup.close();
|
|
});
|
|
});
|
|
},
|
|
},
|