From c9431f62efbcae47c65a6ce27973797eee865282 Mon Sep 17 00:00:00 2001 From: Mike Fitzpatrick Date: Tue, 29 May 2018 01:07:25 -0400 Subject: [PATCH] - profiles service fixes --- src/services/profiles.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/services/profiles.ts b/src/services/profiles.ts index 572e2b2..155238f 100644 --- a/src/services/profiles.ts +++ b/src/services/profiles.ts @@ -67,16 +67,16 @@ export class ProfileService { ) } - getNextProfile(id, type) { - var nextIdIndex = this.idMap[id] + 1; - nextIdIndex = nextIdIndex >= this.profiles.length ? 0 : nextIdIndex; - return this.profiles[nextIdIndex]; + getNextProfile(id, type = 'all') { + var nextIdIndex = this.idMap[type][id] + 1; + nextIdIndex = nextIdIndex >= this.profiles[type].length ? 0 : nextIdIndex; + return this.profiles[type][nextIdIndex]; } - getPreviousProfile(id, type) { - var prevIdIndex = this.idMap[id] + 1; - prevIdIndex = prevIdIndex < 0 ? (this.profiles.length - 1) : prevIdIndex; - return this.profiles[prevIdIndex]; + getPreviousProfile(id, type = 'all') { + var prevIdIndex = this.idMap[type][id] - 1; + prevIdIndex = prevIdIndex < 0 ? (this.profiles[type].length - 1) : prevIdIndex; + return this.profiles[type][prevIdIndex]; } getProfiles() {