Skip to content

Commit

Permalink
Step 23.27: Fix an issuewith a absolute path of an image
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and DAB0mB committed Dec 14, 2016
1 parent ab609b6 commit bb332f3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion 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'
Expand All @@ -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;
Expand Down

0 comments on commit bb332f3

Please sign in to comment.