@@ -5,16 +5,14 @@ import { SplashScreen } from '@ionic-native/splash-screen';
5
5
import { IntroSliderPage } from '../pages/intro-slider/intro-slider' ;
6
6
import { TabsPage } from '../pages/tabs/tabs' ;
7
7
import { AutenticationProvider } from '../providers/autentication/autentication' ;
8
- import { delay } from 'rxjs/operator/delay' ;
9
8
10
9
@Component ( {
11
10
templateUrl : 'app.html'
12
11
} )
13
12
export class MyApp {
14
13
15
14
rootPage :any
16
-
17
-
15
+
18
16
constructor ( platform : Platform , statusBar : StatusBar , splashScreen : SplashScreen ,
19
17
public authentication : AutenticationProvider )
20
18
{
@@ -25,33 +23,29 @@ export class MyApp {
25
23
splashScreen . hide ( ) ;
26
24
27
25
} ) ;
28
- //async calling
29
- //this.helper();
30
- console . log ( "before" ) ;
26
+
27
+ //check if current user is login, initialize authentication.loggedIn attr.
31
28
this . authentication . isLoggedIn ( ) ;
32
- console . log ( "after" ) ;
29
+ //considering authentication.loggedIn set the following page: homePage or loginPage
33
30
this . getRootPage ( ) ;
34
31
}
35
- //logic to choose root page, uses LoginProvider
36
- //make sure to update it when implementing login feature
37
32
33
+ //---------------------------------------------------------------------------//
34
+ //considering authentication.loggedIn set the following page: homePage or loginPage
35
+ //if current user doesn't logged in -> popup google login window.
38
36
getRootPage ( ) {
39
37
if ( this . authentication . loggedInStatus ( ) ) {
40
38
this . rootPage = TabsPage ;
41
39
}
42
40
else {
43
- this . rootPage = IntroSliderPage ;
41
+ this . rootPage = IntroSliderPage ;
44
42
this . authentication . createAuthentication ( ) . then ( ( ) => {
45
43
this . rootPage = TabsPage ;
46
44
} )
47
45
48
46
}
49
47
}
50
-
51
- public async helper ( ) {
52
-
53
- }
54
-
48
+ //---------------------------------------------------------------------------//
55
49
56
50
57
51
}
0 commit comments