From c93e625a228c37cc271bf606d2df77c97739b309 Mon Sep 17 00:00:00 2001 From: dotansimha Date: Tue, 24 Jan 2017 16:12:33 +0200 Subject: [PATCH] Step 7.15: Add user identification in app's main component --- src/app/app.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index a61cc2deb..43a8df645 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -3,14 +3,18 @@ import { Platform } from 'ionic-angular'; import { StatusBar } from '@ionic-native/status-bar'; import { SplashScreen } from '@ionic-native/splash-screen'; import { ChatsPage } from '../pages/chats/chats'; +import { Meteor } from 'meteor/meteor'; +import { LoginPage } from '../pages/login/login'; @Component({ templateUrl: 'app.html' }) export class MyApp { - rootPage:any = ChatsPage; + rootPage: any; constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) { + this.rootPage = Meteor.user() ? ChatsPage : LoginPage; + 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.