From bb332f30f70a282c5cd9cb1866269fc70f0060a9 Mon Sep 17 00:00:00 2001 From: dotansimha Date: Wed, 28 Sep 2016 13:28:06 +0300 Subject: [PATCH] Step 23.27: Fix an issuewith a absolute path of an image --- client/imports/app/shared/display-main-image.pipe.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/imports/app/shared/display-main-image.pipe.ts b/client/imports/app/shared/display-main-image.pipe.ts index c98e95208..dda5f05e8 100644 --- a/client/imports/app/shared/display-main-image.pipe.ts +++ b/client/imports/app/shared/display-main-image.pipe.ts @@ -1,6 +1,7 @@ import {Pipe, PipeTransform} from '@angular/core'; import { Images } from '../../../../both/collections/images.collection'; import { Party } from '../../../../both/models/party.model'; +import { Meteor } from "meteor/meteor"; @Pipe({ name: 'displayMainImage' @@ -17,7 +18,12 @@ export class DisplayMainImagePipe implements PipeTransform { const found = Images.findOne(imageId); if (found) { - imageUrl = found.url; + if (!Meteor.isCordova) { + imageUrl = found.url; + } else { + const path = `ufs/${found.store}/${found._id}/${found.name}`; + imageUrl = Meteor.absoluteUrl(path); + } } return imageUrl;