import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import {LoginPage} from '../pages/login/login';
import { TabsPage } from '../pages/tabs/tabs';
import { Loading } from 'ionic-angular/components/loading/loading';
import { AuthServiceProvider } from '../providers/auth-service/auth-service';

@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  rootPage:any = LoginPage;

  constructor(platform: Platform, private authservice: AuthServiceProvider, 
    public statusBar: StatusBar,
    public splashScreen: SplashScreen) {
      if((window.localStorage.getItem('userMobile') === "undefined" || window.localStorage.getItem('userMobile') === null) && 
      (window.localStorage.getItem('password') === "undefined" || window.localStorage.getItem('password') === null)) {
     this.rootPage = LoginPage;
     //console.log("if app "+window.localStorage.getItem('userMobile'));
   } else {
     this.rootPage = TabsPage;
     //console.log("else app "+window.localStorage.getItem('userMobile'));
   }
  }
  
}
