Project

General

Profile

« Previous | Next » 

Revision 61263

[Library | Angular 11]: Merge changes from trunk

View differences:

organization.component.ts
92 92
  private funderId: string;
93 93
  private funderCount: number;
94 94
  subscriptions = [];
95
  innerReportSubscriptions = [];
95 96
  properties: EnvProperties;
96 97
  public indexUpdateDate: Date;
97 98
  public showFeedback: boolean = false;
......
188 189
        subscription.unsubscribe();
189 190
      }
190 191
    });
192
    this.innerReportSubscriptions.forEach(subscription => {
193
      if(subscription instanceof Subscriber) {
194
        subscription.unsubscribe();
195
      }
196
    });
197

  
191 198
    this.fetchDatasets.clearSubscriptions();
192 199
    this.fetchPublications.clearSubscriptions();
193 200
    this.fetchSoftware.clearSubscriptions();
......
390 397
      data => {
391 398
        projects = data[1];
392 399
        for (let index = 0; index < projects.length; index++) {
393
          this.subscriptions.push(this._searchResearchResultsService.numOfEntityResults(this.funderContentType, projects[index].id, "project", this.properties).subscribe(
400
          this.innerReportSubscriptions.push(this._searchResearchResultsService.numOfEntityResults(this.funderContentType, projects[index].id, "project", this.properties).subscribe(
394 401
            data => {
395 402
              //if(data == 0 && title) {   // if no publications for this project
396 403
              if (data == 0 && (counter > 1 || title)) {   // if no publications for this project
......
435 442
                }
436 443
                title = true;
437 444

  
438
                this.subscriptions.push(this._reportsService.getCSVResponse(url).subscribe(
445
                this.innerReportSubscriptions.push(this._reportsService.getCSVResponse(url).subscribe(
439 446
                  data => {
440 447
                    counter--;
441 448
                    response[index] = data;
......
473 480
                    
474 481
                    this.closeLoading();
475 482
                    this.confirmOpenCsvError();
483
                    this.innerReportSubscriptions.forEach(subscription => subscription.unsubscribe());
476 484
                  }/*,
477 485
                            () => console.log('Completed file download.')*/
478 486
                ) );
......
481 489
            err => {
482 490
              this.handleError("Error getting number of publications for project with id: " + projects[index].id, err);
483 491
              this.closeLoading();
492
              this.confirmOpenCsvError();
493
              this.innerReportSubscriptions.forEach(subscription => subscription.unsubscribe());
484 494
            }));
485 495
        }
486 496
      },

Also available in: Unified diff