Marc Hartmayer 2020-05-24 11:01:53 +02:00
parent d5fbd50b76
commit b7105d7b57

View file

@ -151,8 +151,9 @@ BlazeComponent.extendComponent({
}, },
attachmentLink() { attachmentLink() {
const attachment = this.currentData().activity.attachment(); const activity = this.currentData().activity;
const link = attachment.link('original', '/'); const attachment = activity.attachment();
const link = attachment ? attachment.link('original', '/') : null;
// trying to display url before file is stored generates js errors // trying to display url before file is stored generates js errors
return ( return (
(attachment && (attachment &&
@ -166,7 +167,7 @@ BlazeComponent.extendComponent({
attachment.name, attachment.name,
), ),
)) || )) ||
this.currentData().activity.attachmentName activity.attachmentName
); );
}, },