Ver código fonte

fix: cover image - works now

David Arnold 4 anos atrás
pai
commit
e4e8da4718
2 arquivos alterados com 2 adições e 5 exclusões
  1. 1 1
      client/components/cards/minicard.jade
  2. 1 4
      models/cards.js

+ 1 - 1
client/components/cards/minicard.jade

@@ -7,7 +7,7 @@ template(name="minicard")
       .handle
         .fa.fa-arrows
     if cover
-      .minicard-cover(style="background-image: url('{{cover.url}}');")
+      .minicard-cover(style="background-image: url('{{cover.link}}');")
     if labels
       .minicard-labels(class="{{#if hiddenMinicardLabelText}}minicard-labels-no-text{{/if}}")
         each labels

+ 1 - 4
models/cards.js

@@ -751,10 +751,7 @@ Cards.helpers({
 
   cover() {
     if (!this.coverId) return false;
-    const cover = Attachments.findOne(this.coverId);
-    // if we return a cover before it is fully stored, we will get errors when we try to display it
-    // todo XXX we could return a default "upload pending" image in the meantime?
-    return cover && cover.url() && cover;
+    return Attachments.findOne(this.coverId);
   },
 
   checklists() {