11import { Component , OnInit } from '@angular/core' ;
2- import { Chats , Users } from 'api/collections' ;
2+ import { Chats , Users , Pictures } from 'api/collections' ;
33import { User } from 'api/models' ;
4- import { AlertController , ViewController } from 'ionic-angular' ;
4+ import { AlertController , Platform , ViewController } from 'ionic-angular' ;
55import { MeteorObservable } from 'meteor-rxjs' ;
66import * as _ from 'lodash' ;
77import { Observable , Subscription , BehaviorSubject } from 'rxjs' ;
@@ -18,7 +18,8 @@ export class NewChatComponent implements OnInit {
1818
1919 constructor (
2020 private alertCtrl : AlertController ,
21- private viewCtrl : ViewController
21+ private viewCtrl : ViewController ,
22+ private platform : Platform
2223 ) {
2324 this . senderId = Meteor . userId ( ) ;
2425 this . searchPattern = new BehaviorSubject ( undefined ) ;
@@ -107,4 +108,12 @@ export class NewChatComponent implements OnInit {
107108
108109 alert . present ( ) ;
109110 }
111+
112+ getPic ( pictureId ) : string {
113+ let platform = this . platform . is ( 'android' ) ? "android" :
114+ this . platform . is ( 'ios' ) ? "ios" : "" ;
115+ platform = this . platform . is ( 'cordova' ) ? platform : "" ;
116+
117+ return Pictures . getPictureUrl ( pictureId , platform ) ;
118+ }
110119}
0 commit comments