Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. let trip_flags = this.tripFlags.fetch();
  2. if(trip_flags.length == 0 || (trip_flags.length > 0 && !trip_flags[0].isDriver && trip_flags[0].code_sent)) {
  3. console.log('no active trips');
  4. this.rootPage = DashboardMobileComponent;
  5. } else {
  6. this.rootPage = OnTripMobileComponent;
  7. }
  8.  
  9. this.tripFlags.subscribe((data: UserTripFlag[]) => {
  10. if(data.length > 0) {
  11. if(!data[0].isDriver && data[0].code_sent) {
  12. me.rootPage = DashboardMobileComponent;
  13. } else {
  14. console.log('user is on a trip');
  15. if(this.rootPage != OnTripMobileComponent) {
  16. this.statusBar.show();
  17. me.rootPage = OnTripMobileComponent;
  18. }
  19. }
  20.  
  21. } else {
  22. me.rootPage = DashboardMobileComponent;
  23. }
  24. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement