From fb74882c1f43ccf39a846e93a480adcd1d4c2d04 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Mon, 2 Jul 2018 13:42:20 +0000 Subject: [PATCH] more checks for reload not to lose parameters and to set them properly git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@52646 d315682c-612b-4755-9ff5-7f18f6832af3 --- login/userMini.component.ts | 18 +++++++++--------- login/utils/helper.class.ts | 5 ++--- reload/reload.component.ts | 4 ++-- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/login/userMini.component.ts b/login/userMini.component.ts index d09b5763..0477e16d 100644 --- a/login/userMini.component.ts +++ b/login/userMini.component.ts @@ -113,7 +113,7 @@ export class UserMiniComponent { }else { this.isAuthorized = false; } - + }else { this.loggedIn = false; this.isAuthorized = false; @@ -121,14 +121,14 @@ export class UserMiniComponent { } } - gotoUserPage(){ - this.redirectUrl = this.location.path(); - if(this.redirectUrl && this.redirectUrl != null && this.redirectUrl != "" && this.redirectUrl !="user-info"){ - this.router.navigate([this.baseUrl], { queryParams: this.routerHelper.createQueryParam("redirectUrl",this.redirectUrl )}); - }else{ - this.router.navigate([this.baseUrl]); - } - } + // gotoUserPage(){ + // this.redirectUrl = this.location.path(); + // if(this.redirectUrl && this.redirectUrl != null && this.redirectUrl != "" && this.redirectUrl !="user-info"){ + // this.router.navigate([this.baseUrl], { queryParams: this.routerHelper.createQueryParam("redirectUrl",this.redirectUrl )}); + // }else{ + // this.router.navigate([this.baseUrl]); + // } + // } logOut(){ if(Session.isLoggedIn()){ Session.removeUser(); diff --git a/login/utils/helper.class.ts b/login/utils/helper.class.ts index 320ba6e7..984ddb4a 100644 --- a/login/utils/helper.class.ts +++ b/login/utils/helper.class.ts @@ -104,12 +104,11 @@ export class Session{ } public static getParamsObj(params:string) { - - var object = null; + var object = null; if(params.split("&").length > 0){ object = {}; } - params =(params && params.split("?").length > 0 )?params.split("?")[1]:params; + params =(params && params.split("?").length > 1 )?params.split("?")[1]:params; for(var i=0; i