Done attachments activities operating

This commit is contained in:
Romulus Urakagi Tsai 2020-05-08 09:32:19 +08:00
parent 7dc0bbd7b2
commit 4448488767
3 changed files with 74 additions and 188 deletions

View file

@ -152,17 +152,18 @@ BlazeComponent.extendComponent({
attachmentLink() {
const attachment = this.currentData().attachment();
const link = attachment.link('original', '/');
// trying to display url before file is stored generates js errors
return (
attachment &&
attachment.url({ download: true }) &&
link &&
Blaze.toHTML(
HTML.A(
{
href: attachment.url({ download: true }),
href: link,
target: '_blank',
},
attachment.name(),
attachment.get('name'),
),
)
);