1
1
import { CCDLUploadService } from 'src/app/service/Upload/CCDLUpload.service' ;
2
2
import { Component , ElementRef , OnDestroy , OnInit } from '@angular/core' ;
3
+ import { DataSelectionFactoryService } from 'src/app/service/DataSelection/DataSelection.factory.service' ;
3
4
import { DataSelectionProviderService } from 'src/app/modules/data-selection/services/DataSelectionProvider.service' ;
4
5
import { DownloadCRDTLService } from 'src/app/service/Download/DownloadCRDTL.service' ;
5
6
import { DownloadDataSelectionComponent } from '../download-data-selection/download-data-selection.component' ;
@@ -9,8 +10,6 @@ import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
9
10
import { NavigationHelperService } from 'src/app/service/NavigationHelper.service' ;
10
11
import { Observable , Subscription } from 'rxjs' ;
11
12
import { SnackbarService } from 'src/app/shared/service/Snackbar/Snackbar.service' ;
12
- import { DataSelectionFactoryService } from 'src/app/service/DataSelection/DataSelection.factory.service' ;
13
- import { is } from 'cypress/types/bluebird' ;
14
13
15
14
@Component ( {
16
15
selector : 'num-data-selection-action-bar' ,
@@ -25,6 +24,8 @@ export class DataSelectionActionBarComponent implements OnDestroy, OnInit {
25
24
26
25
downloadSubscription : Subscription ;
27
26
27
+ mainProfileSubscription : Subscription ;
28
+
28
29
constructor (
29
30
public elementRef : ElementRef ,
30
31
private dataSelectionProviderService : DataSelectionProviderService ,
@@ -45,17 +46,17 @@ export class DataSelectionActionBarComponent implements OnDestroy, OnInit {
45
46
}
46
47
47
48
ngOnDestroy ( ) : void {
48
- if ( this . subscription ) {
49
- this . subscription ?. unsubscribe ( ) ;
50
- }
49
+ this . mainProfileSubscription ?. unsubscribe ( ) ;
50
+ this . subscription ?. unsubscribe ( ) ;
51
51
}
52
52
53
53
public editDataSelection ( ) {
54
54
this . navigationHelperService . navigateToDataSelectionEditor ( ) ;
55
55
}
56
56
57
57
public createNewDataSelection ( ) {
58
- this . dataSelectionFactoryService . instantiate ( ) ;
58
+ this . mainProfileSubscription ?. unsubscribe ( ) ;
59
+ this . dataSelectionFactoryService . instantiate ( ) . subscribe ( ) ;
59
60
this . navigationHelperService . navigateToDataSelectionSearch ( ) ;
60
61
}
61
62
0 commit comments