Merge branch 'release/2.0.5'

This commit is contained in:
2018-05-29 19:13:49 -04:00
2 changed files with 6 additions and 6 deletions

View File

@@ -5,7 +5,6 @@ import { NavController } from 'ionic-angular';
import { ChatPage } from '../chat/chat'; import { ChatPage } from '../chat/chat';
import { ProfileService } from '../../services/profiles'; import { ProfileService } from '../../services/profiles';
import { ProfilePage } from '../profile/profile'; import { ProfilePage } from '../profile/profile';
import { TellYourStoryPage } from '../tell/tell';
@Component({ @Component({
selector: 'page-grid', selector: 'page-grid',
@@ -20,6 +19,7 @@ export class GridPage {
constructor(public navCtrl: NavController, public profileService: ProfileService, private _sanitizer: DomSanitizer) { constructor(public navCtrl: NavController, public profileService: ProfileService, private _sanitizer: DomSanitizer) {
profileService.loadVerified().then((data) => { profileService.loadVerified().then((data) => {
this.profiles = data; this.profiles = data;
console.debug('profiles: ', this.profiles);
}); });
this.tabNavEl = document.querySelector('#tab-nav .tabbar'); this.tabNavEl = document.querySelector('#tab-nav .tabbar');
} }

View File

@@ -53,7 +53,7 @@ export class ProfileService {
.map(res => res.json()) .map(res => res.json())
.subscribe( .subscribe(
data => { data => {
this.profiles = {}; this.profiles = this.profiles || {};
this.profiles[type] = data; this.profiles[type] = data;
this.profiles[type].reduce((map, profile, i) => { this.profiles[type].reduce((map, profile, i) => {
map[profile._id] = i; map[profile._id] = i;
@@ -62,7 +62,7 @@ export class ProfileService {
resolve(this.profiles[type]); resolve(this.profiles[type]);
}, },
error => { error => {
this.doGetRequest(this.fallback, resolve); this.doGetRequest(this.fallback, resolve, type);
} }
) )
} }
@@ -80,7 +80,7 @@ export class ProfileService {
} }
getProfiles() { getProfiles() {
return this.profiles; return this.profiles.all;
} }
getProfileById(id) { getProfileById(id) {
@@ -88,10 +88,10 @@ export class ProfileService {
} }
getSubmittedProfiles() { getSubmittedProfiles() {
return this.profiles.submitted;
} }
getVerifiedProfiles() { getVerifiedProfiles() {
return this.profiles.verified;
} }
} }