summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--client/components/cards/attachments.js8
2 files changed, 8 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 97497b7a..8517746a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@ This release adds the following new features:
* [Change password of any user in Standalone Wekan Admin Panel](https://github.com/wekan/wekan/pull/1372);
* [Performance optimization: Move more global subscriptions to template subscription](https://github.com/wekan/wekan/pull/1373);
+* [Auto update card cover with latest uploaded image attachment](https://github.com/wekan/wekan/pull/1387).
* Update tranlations. Add Latvian language;
* Update to Meteor 1.6.0, Node 6.12.2 and MongoDB 3.2.18.
diff --git a/client/components/cards/attachments.js b/client/components/cards/attachments.js
index 36e8a5ec..b1f88bf1 100644
--- a/client/components/cards/attachments.js
+++ b/client/components/cards/attachments.js
@@ -60,7 +60,13 @@ Template.cardAttachmentsPopup.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);
+ }
+
Popup.close();
});
},