Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let trip_flags = this.tripFlags.fetch();
- if(trip_flags.length == 0 || (trip_flags.length > 0 && !trip_flags[0].isDriver && trip_flags[0].code_sent)) {
- console.log('no active trips');
- this.rootPage = DashboardMobileComponent;
- } else {
- this.rootPage = OnTripMobileComponent;
- }
- this.tripFlags.subscribe((data: UserTripFlag[]) => {
- if(data.length > 0) {
- if(!data[0].isDriver && data[0].code_sent) {
- me.rootPage = DashboardMobileComponent;
- } else {
- console.log('user is on a trip');
- if(this.rootPage != OnTripMobileComponent) {
- this.statusBar.show();
- me.rootPage = OnTripMobileComponent;
- }
- }
- } else {
- me.rootPage = DashboardMobileComponent;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement