From a8ef3651c56e3de6cbc443a8c31c46c24b95bd3b Mon Sep 17 00:00:00 2001 From: Georgi Prodanov Date: Thu, 16 Feb 2017 12:15:00 +0200 Subject: [PATCH] #328925 Only show empty events screen after events have been loaded. --- app/groups/group-events/group-events.component.ts | 12 +++++------- app/groups/group-members/group-members.template.html | 4 ++-- package.json | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/groups/group-events/group-events.component.ts b/app/groups/group-events/group-events.component.ts index 5b81628..5700af2 100644 --- a/app/groups/group-events/group-events.component.ts +++ b/app/groups/group-events/group-events.component.ts @@ -35,13 +35,11 @@ export class GroupEventsComponent implements OnInit { this._page.actionBar.title = ''; this._route.params.subscribe(params => { this._groupId = params['id']; - - this._eventsService.getUpcoming([this._groupId]) - .then(upcomingEvents => { - this.events = upcomingEvents; - return this._eventsService.getPast([this._groupId]); - }) - .then(pastEvents => this.events = this.events.concat(pastEvents)) + let upcomingPrm = this._eventsService.getUpcoming([this._groupId]); + let pastPrm = this._eventsService.getPast([this._groupId]); + + Promise.all([upcomingPrm, pastPrm]) + .then(results => this.events = results[0].concat(results[1])) .catch(this._onError.bind(this)); this._groupsService.getById(this._groupId) diff --git a/app/groups/group-members/group-members.template.html b/app/groups/group-members/group-members.template.html index dd1e966..b3c3b5c 100644 --- a/app/groups/group-members/group-members.template.html +++ b/app/groups/group-members/group-members.template.html @@ -2,10 +2,10 @@ - - + --> diff --git a/package.json b/package.json index 5d060c0..85d9bf8 100644 --- a/package.json +++ b/package.json @@ -41,4 +41,4 @@ "typescript": "^2.0.6", "zone.js": "~0.6.21" } -} \ No newline at end of file +}