diff options
author | Lauri Ojansivu <x@xet7.org> | 2020-05-24 18:51:12 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2020-05-24 18:51:12 +0300 |
commit | 2df29324e6355b7e0b5f1c172fdd1b330713bcf4 (patch) | |
tree | 6f501d5e4a5599e86f547786f3c3eac8ea73d52e | |
parent | 06515559a62a9caea7e31326c381dac0d40f710b (diff) | |
parent | 66d35a15280795b76a81c3e59cebbd2a29e4dff8 (diff) | |
download | wekan-2df29324e6355b7e0b5f1c172fdd1b330713bcf4.tar.gz wekan-2df29324e6355b7e0b5f1c172fdd1b330713bcf4.tar.bz2 wekan-2df29324e6355b7e0b5f1c172fdd1b330713bcf4.zip |
Merge branch 'marc1006-minor_fixes'
-rw-r--r-- | client/components/activities/activities.js | 7 | ||||
-rw-r--r-- | client/components/cards/cardDetails.js | 9 | ||||
-rw-r--r-- | models/cards.js | 1 |
3 files changed, 13 insertions, 4 deletions
diff --git a/client/components/activities/activities.js b/client/components/activities/activities.js index 186200ec..4f15d421 100644 --- a/client/components/activities/activities.js +++ b/client/components/activities/activities.js @@ -151,8 +151,9 @@ BlazeComponent.extendComponent({ }, attachmentLink() { - const attachment = this.currentData().activity.attachment(); - const link = attachment.link('original', '/'); + const activity = this.currentData().activity; + const attachment = activity.attachment(); + const link = attachment ? attachment.link('original', '/') : null; // trying to display url before file is stored generates js errors return ( (attachment && @@ -166,7 +167,7 @@ BlazeComponent.extendComponent({ attachment.name, ), )) || - this.currentData().activity.attachmentName + activity.attachmentName ); }, diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 441068b0..11e010d4 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -74,11 +74,18 @@ BlazeComponent.extendComponent({ scrollParentContainer() { const cardPanelWidth = 510; - const bodyBoardComponent = this.parentComponent().parentComponent(); + const parentComponent = this.parentComponent(); + // TODO sometimes parentComponent is not available, maybe because it's not + // yet created?! + if (!parentComponent) return; + const bodyBoardComponent = parentComponent.parentComponent(); //On Mobile View Parent is Board, Not Board Body. I cant see how this funciton should work then. if (bodyBoardComponent === null) return; const $cardView = this.$(this.firstNode()); const $cardContainer = bodyBoardComponent.$('.js-swimlanes'); + // TODO sometimes cardContainer is not available, maybe because it's not yet + // created?! + if (!$cardContainer) return; const cardContainerScroll = $cardContainer.scrollLeft(); const cardContainerWidth = $cardContainer.width(); diff --git a/models/cards.js b/models/cards.js index f4bb464c..757772f3 100644 --- a/models/cards.js +++ b/models/cards.js @@ -535,6 +535,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? |