diff --git a/src/app/pages/home/home.component.ts b/src/app/pages/home/home.component.ts index 0f6cbde..efe0b3e 100644 --- a/src/app/pages/home/home.component.ts +++ b/src/app/pages/home/home.component.ts @@ -17,7 +17,6 @@ export class HomeComponent implements OnInit { constructor( private _dbService:DatabaseService, private route:Router ) { const UID = JSON.parse(localStorage.getItem('user')).uid; - console.log(UID); this._dbService.getDataQuery('books', 'status', '==', 'available') .valueChanges() diff --git a/src/app/register/login.component.ts b/src/app/register/login.component.ts index bd85c33..ad250e8 100644 --- a/src/app/register/login.component.ts +++ b/src/app/register/login.component.ts @@ -31,6 +31,8 @@ export class LoginComponent implements OnInit { private router:Router, private _db:DatabaseService ) { + if( JSON.parse(localStorage.getItem('session')).session ) router.navigate(['/']); + this.afAuth.authState.subscribe( user => { console.log( 'Estado del usuario', user ); if( !user ){ diff --git a/src/app/register/register.component.ts b/src/app/register/register.component.ts index f848bc5..084463a 100644 --- a/src/app/register/register.component.ts +++ b/src/app/register/register.component.ts @@ -40,7 +40,9 @@ export class RegisterComponent implements OnInit { constructor( private _dbService:DatabaseService, private _dateService:DateService, private afAuth: AngularFireAuth, - public router: Router ) { } + public router: Router ) { + if( JSON.parse(localStorage.getItem('session')).session ) router.navigate(['/']); + } ngOnInit() { init_plugins();