My app.component contains a background mode service that shares data via intent to a behavior Subject.
this._notification.setNotiService2(data.extras);
After logging in, the root is set to TabsPage.
this.appCtrl.getRootNav().setRoot('TabsPage');
On the Tabs Page, I subscribe to the behavior subject. This allows me to process shared objects and display their values in a Modal. Everything works fine initially when the app is opened. However, issues arise when logging in or out. Upon logging out, the root page is set to LoginPage.
this.appCtrl.getRootNav().setRoot('LoginPage');
Upon successful login, the root is set back to TabsPage.
this.appCtrl.getRootNav().setRoot('TabsPage');
If I share values multiple times via intent, multiple instances of the Modal open with the same values. Even though I have checked for null/undefined behavior subjects, the subscribed value seems to be correct. When logging the value from the behavior Subject inside the TabsPage, I noticed that the same function (subscribed behavior subject) is being called twice.
After logging out and in again, the Modal opens three times, and this number continues to increase with each logout/login cycle.