Skip to content

Commit afd7cd0

Browse files
dotansimhadarkbasic
authored andcommitted
Step 7.15: Add user identification in app's main component
1 parent 7e153ee commit afd7cd0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/app/app.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ import { Platform } from 'ionic-angular';
33
import { StatusBar } from '@ionic-native/status-bar';
44
import { SplashScreen } from '@ionic-native/splash-screen';
55
import { ChatsPage } from '../pages/chats/chats';
6+
import { Meteor } from 'meteor/meteor';
7+
import { LoginPage } from '../pages/login/login';
68

79
@Component({
810
templateUrl: 'app.html'
911
})
1012
export class MyApp {
11-
rootPage:any = ChatsPage;
13+
rootPage: any;
1214

1315
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
16+
this.rootPage = Meteor.user() ? ChatsPage : LoginPage;
17+
1418
platform.ready().then(() => {
1519
// Okay, so the platform is ready and our plugins are available.
1620
// Here you can do any higher level native things you might need.

0 commit comments

Comments
 (0)