Skip to content

Commit

Permalink
Step 7.7: Wait for user if logging in
Browse files Browse the repository at this point in the history
  • Loading branch information
DAB0mB committed Feb 26, 2017
1 parent f547fa3 commit fa59b74
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/main.ts
Expand Up @@ -2,9 +2,17 @@ import 'zone.js';
import 'reflect-metadata';

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { MeteorObservable } from 'meteor-rxjs';
import { Meteor } from 'meteor/meteor';
import { AppModule } from './imports/app/app.module';

Meteor.startup(() => {
platformBrowserDynamic().bootstrapModule(AppModule);
const subscription = MeteorObservable.autorun().subscribe(() => {
if (Meteor.loggingIn()) {
return;
}

setTimeout(() => subscription.unsubscribe());
platformBrowserDynamic().bootstrapModule(AppModule);
});
});

0 comments on commit fa59b74

Please sign in to comment.