EOSC transfer service: checklogin when modal opens

This commit is contained in:
argirok 2022-05-18 16:59:36 +03:00
parent e233a32875
commit 5d6d7bcc78
1 changed files with 11 additions and 13 deletions

View File

@ -126,20 +126,9 @@ export class EGIDataTransferComponent {
} }
ngOnInit() { ngOnInit() {
console.log( window.location.href) if(this.isOpen){
console.log(COOKIE.getCookie("EGIAccessToken")) this.open();
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);
}
} }
this.selectedSourceUrl = this.sourceUrls[0];
this.selectedDestination = this.destinationOptions[0].value;
this.parse();
} }
ngOnDestroy() { ngOnDestroy() {
@ -151,6 +140,15 @@ export class EGIDataTransferComponent {
} }
open(){ 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; this.isOpen = true;
} }
close(){ close(){