diff --git a/TutorNow/src/pages/client-request/client-request.ts b/TutorNow/src/pages/client-request/client-request.ts index 12535e2..4dfec61 100755 --- a/TutorNow/src/pages/client-request/client-request.ts +++ b/TutorNow/src/pages/client-request/client-request.ts @@ -53,22 +53,23 @@ export class ClientRequestPage { requesterId: Meteor.userId(), handshake: handshake }); - + + let navCtrl = this.navCtrl; const handle = cursor.observe({ added(ack:Acknowledge) { - loading.dismiss(); + let navTransition = loading.dismiss(); console.log(JSON.stringify(ack)); if(ack.requesterId === Meteor.userId() && ack.handshake === handshake && ack.accepted) { handle.stop(); //requesting = false; - //this.navCtrl.setRoot(InProgressPage, { - //tutorLocation: this.tutorLocation, - //tutorUser: this.tutoruser, - //sessionId: this.handeshake - //}, { - // animate: true - //}); - alert("Accepted"); + navTransition.then(() => { + navCtrl.setRoot(InProgressPage, { + acknowledgeId: ack._id, + }, { + animate: true + }); + }); + //alert("Accepted"); } else { // rejected :( alert("Rejected"); diff --git a/TutorNow/src/pages/in-progress/in-progress.ts b/TutorNow/src/pages/in-progress/in-progress.ts index 68d5fca..349dea6 100644 --- a/TutorNow/src/pages/in-progress/in-progress.ts +++ b/TutorNow/src/pages/in-progress/in-progress.ts @@ -1,6 +1,8 @@ import { Component, OnInit, OnDestroy } from '@angular/core'; import { Platform, NavController, NavParams } from 'ionic-angular'; import { ClientSummaryPage } from '../client-summary/client-summary'; +import { Acknowledge } from 'api/models'; +import { Acknowledges } from 'api/collections/acknowledges'; import * as moment from 'moment'; @Component({ @@ -8,14 +10,20 @@ import * as moment from 'moment'; templateUrl: 'in-progress.html' }) export class InProgressPage { + private acknowledge: Acknowledge; + private acknowledgeId: string; + constructor(public navCtrl: NavController, public navParams: NavParams, private platform:Platform,) { + this.acknowledgeId = navParams.get('acknowledgeId'); } private start:string; ngOnInit() { this.start = moment().format("H:m A"); + + this.acknowledge = Acknowledges.findOne(this.acknowledgeId); } finishTutoring() { diff --git a/TutorNow/src/pages/list/list.ts b/TutorNow/src/pages/list/list.ts index 75c452a..b37d853 100755 --- a/TutorNow/src/pages/list/list.ts +++ b/TutorNow/src/pages/list/list.ts @@ -84,8 +84,9 @@ export class ListPage implements OnInit, OnDestroy { navTransition.then(() => { // push new view and join session navCtrl.setRoot(InProgressPage, { - animate: true, acknowledgeId: acknowledgeId, + }, { + animate: true }) }) return false;