From 048c2edb9b7226e894dec4c29ab688de02b29774 Mon Sep 17 00:00:00 2001 From: Mike Fitzpatrick Date: Tue, 29 May 2018 19:13:26 -0400 Subject: [PATCH] - Grid fixes --- src/pages/grid/grid.ts | 2 +- src/services/profiles.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/grid/grid.ts b/src/pages/grid/grid.ts index 17c8dbd..3570b99 100644 --- a/src/pages/grid/grid.ts +++ b/src/pages/grid/grid.ts @@ -5,7 +5,6 @@ import { NavController } from 'ionic-angular'; import { ChatPage } from '../chat/chat'; import { ProfileService } from '../../services/profiles'; import { ProfilePage } from '../profile/profile'; -import { TellYourStoryPage } from '../tell/tell'; @Component({ selector: 'page-grid', @@ -20,6 +19,7 @@ export class GridPage { constructor(public navCtrl: NavController, public profileService: ProfileService, private _sanitizer: DomSanitizer) { profileService.loadVerified().then((data) => { this.profiles = data; + console.debug('profiles: ', this.profiles); }); this.tabNavEl = document.querySelector('#tab-nav .tabbar'); } diff --git a/src/services/profiles.ts b/src/services/profiles.ts index 39f2945..f4402c8 100644 --- a/src/services/profiles.ts +++ b/src/services/profiles.ts @@ -53,7 +53,7 @@ export class ProfileService { .map(res => res.json()) .subscribe( data => { - this.profiles = {}; + this.profiles = this.profiles || {}; this.profiles[type] = data; this.profiles[type].reduce((map, profile, i) => { map[profile._id] = i; @@ -62,7 +62,7 @@ export class ProfileService { resolve(this.profiles[type]); }, error => { - this.doGetRequest(this.fallback, resolve); + this.doGetRequest(this.fallback, resolve, type); } ) } @@ -80,7 +80,7 @@ export class ProfileService { } getProfiles() { - return this.profiles; + return this.profiles.all; } getProfileById(id) { @@ -88,10 +88,10 @@ export class ProfileService { } getSubmittedProfiles() { - + return this.profiles.submitted; } getVerifiedProfiles() { - + return this.profiles.verified; } }