Skip to content

Commit

Permalink
Fix animation problems ionic-team/ionic-framework#11443
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarpan committed May 24, 2017
1 parent 8488a71 commit 3af01bd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
21 changes: 11 additions & 10 deletions TutorNow/src/pages/client-request/client-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
8 changes: 8 additions & 0 deletions TutorNow/src/pages/in-progress/in-progress.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
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({
selector: 'page-in-progress',
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() {
Expand Down
3 changes: 2 additions & 1 deletion TutorNow/src/pages/list/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3af01bd

Please sign in to comment.