FIREBASE Loses the subscription after loggin


Hi guys,

I have this in my app.components:

platform.ready().then(() => {
  this.afAuth.authState.subscribe((user: firebase.User) => {
        if (user) {
          this.rootPage = TabsPage;
        else {
          this.rootPage = LoginPage;

and this on my tabs.ts

 ngOnInit() {
    this.db.list('/chatsUnreadMessages/' + this.authService.getUID()).subscribe(data => {
      this.contNewMessages = data[0].$value;

The problem is when I log in for the first time. The subscription that I make in tabs.ts to bring me data does not work correctly, since when I make modifications in my database the subscription does not interpret that there were changes and does not jump. The first time after logging in if it brings me data, but if it then occurs any modification does not interpret it and does not bring me the new data.

However, if I close the app and re-enter (with the user already logged in) if I subscribe correctly.

Any ideas?

Thank you