summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/components/cards/attachments.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/client/components/cards/attachments.js b/client/components/cards/attachments.js
index b1f88bf1..bc7d3979 100644
--- a/client/components/cards/attachments.js
+++ b/client/components/cards/attachments.js
@@ -113,7 +113,12 @@ Template.previewClipboardImagePopup.events({
file.boardId = card.boardId;
file.cardId = card._id;
file.userId = Meteor.userId();
- Attachments.insert(file);
+ const attachment = Attachments.insert(file);
+
+ if (attachment && attachment._id && attachment.isImage()) {
+ card.setCover(attachment._id);
+ }
+
pastedResults = null;
$(document.body).pasteImageReader(() => {});
Popup.close();