I'm trying to show the notification when the application is checking any existing user credentials right after the the app starts. I've added the subscription to the auth-service isLoading$ observable in the app-component 's onInit
ngOnInit() {
// Make sure you display the notification when the user check is happening
this.authService.isLoading$.subscribe(isLoading => {
if (isLoading) {
this.notifierService.notify('info', 'Checking user credentials...', this.authLoadingMsg);
}
else {
this.notifierService.hide(this.authLoadingMsg);
}
});
}
but it seems to screw the notifier, as no notifications are shown afterwards. If I delay this subscription, then it works all fine, but somewhat hard-coding the delay is a bad solution I'd say.
There must be something happening that is not yet ready and invalidates the notifier, hence I'd like to get an advice on when/where is the best place to make sure/check if the notifier is actually ready
Hi,
I'm trying to show the notification when the application is checking any existing user credentials right after the the app starts. I've added the subscription to the auth-service
isLoading$
observable in theapp-component
'sonInit
but it seems to screw the notifier, as no notifications are shown afterwards. If I delay this subscription, then it works all fine, but somewhat hard-coding the delay is a bad solution I'd say.
There must be something happening that is not yet ready and invalidates the notifier, hence I'd like to get an advice on when/where is the best place to make sure/check if the notifier is actually ready
Thank you!