[Library|Trunk]

UserMini components: add checks before unsubscribe and use location



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@56940 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2019-08-30 14:53:16 +00:00
parent 6e415283cc
commit 6d49be8553
1 changed files with 4 additions and 2 deletions

View File

@ -99,11 +99,13 @@ export class UserMiniComponent {
}
ngOnDestroy(){
this.sub.unsubscribe();
if(this.sub) {
this.sub.unsubscribe();
}
}
initialize(){
if(!this.redirectUrl) {
if(!this.redirectUrl && location) {
this.redirectUrl = location.pathname;
}
if(Session.isLoggedIn()){