Created
March 1, 2017 16:50
-
-
Save sejr/7bc2d31d30ae4c907656b24aa98ec727 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| constructor( | |
| platform: Platform, | |
| public af: AngularFire, | |
| public loadingCtrl: LoadingController, | |
| public authData: AuthData, | |
| public storage: Storage, | |
| public menuCtrl: MenuController, | |
| ) { | |
| platform.ready().then(() => { | |
| // Okay, so the platform is ready and our plugins are available. | |
| // Here you can do any higher level native things you might need. | |
| this.storage.get('introShown').then((result) => { | |
| if (result) { | |
| const authObserver = af.auth.subscribe( user => { | |
| if (user) { | |
| this.user = af.database.object('/users/' + user.uid); | |
| this.rootPage = HomePage; | |
| authObserver.unsubscribe(); | |
| } else { | |
| this.rootPage = LoginPage; | |
| authObserver.unsubscribe(); | |
| } | |
| }); | |
| } else { | |
| this.rootPage = IntroPage; | |
| this.storage.set('introShown', true); | |
| } | |
| }); | |
| StatusBar.styleDefault(); | |
| Splashscreen.hide(); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment