From 5d6d7bcc786bf93becda21ce2d1b8ad2f68ba3bc Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 18 May 2022 16:59:36 +0300 Subject: [PATCH] EOSC transfer service: checklogin when modal opens --- src/app/utils/transferData.component.ts | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/app/utils/transferData.component.ts b/src/app/utils/transferData.component.ts index 7f7752d..2d9ec53 100644 --- a/src/app/utils/transferData.component.ts +++ b/src/app/utils/transferData.component.ts @@ -126,20 +126,9 @@ export class EGIDataTransferComponent { } ngOnInit() { - console.log( window.location.href) - console.log(COOKIE.getCookie("EGIAccessToken")) - this.accessToken = COOKIE.getCookie("EGIAccessToken"); - for(let doi of this.dois){ - console.log(doi) - if(doi.indexOf("zenodo.")!=-1){ - this.sourceUrls.push("https://doi.org/" + doi); - } - - + if(this.isOpen){ + this.open(); } - this.selectedSourceUrl = this.sourceUrls[0]; - this.selectedDestination = this.destinationOptions[0].value; - this.parse(); } ngOnDestroy() { @@ -151,6 +140,15 @@ export class EGIDataTransferComponent { } open(){ + this.accessToken = COOKIE.getCookie("EGIAccessToken"); + for(let doi of this.dois){ + if(doi.indexOf("zenodo.")!=-1){ + this.sourceUrls.push("https://doi.org/" + doi); + } + } + this.selectedSourceUrl = this.sourceUrls[0]; + this.selectedDestination = this.destinationOptions[0].value; + this.parse(); this.isOpen = true; } close(){