I'm having a really odd problem with my app, localhost seems to work fine for me. But anytime I use ng-build, or ng-build --prod and deploy to my firebase I have issues with retrieving data. Sometimes it will return data like when i load up on my iPad but more often than not it does not find the data.
this.as.userObservable()
.filter(res => res)
.subscribe(user => {
if (this.selectedSeriesSubscription) { this.selectedSeriesSubscription.unsubscribe() }
if (user.selectedSeries) {
this.getSelectedSeries(user.selectedSeries)
} else {
this.fb.settings().valueChanges().take(1)
.subscribe(settings => {
console.log(settings)
this.getSelectedSeries(settings['defaultSeries'])
})
}
});
// SETTINGS - this.fb ^^^
settings() {
return this.afs.doc<any>(`global/settings`);
}
That is the code that is firing, it loads the user and user data before this fine though?
I'm using angularfire2, angular 4. Is this only happening because of my build process?
Any ideas would be appreciated.