@@ -7,16 +7,18 @@ import { TranslateService } from '@ngx-translate/core';
77import {
88 BehaviorSubject ,
99 Observable ,
10+ of ,
1011} from 'rxjs' ;
1112import {
13+ map ,
1214 mergeMap ,
1315 take ,
16+ tap ,
1417} from 'rxjs/operators' ;
1518
19+ import { getHomePageRoute } from '../../../../app-routing-paths' ;
1620import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service' ;
1721import { RequestParam } from '../../../../core/cache/models/request-param.model' ;
18- import { Observable } from 'rxjs' ;
19- import { map , mergeMap , take , tap } from 'rxjs/operators' ;
2022import { ComColDataService } from '../../../../core/data/comcol-data.service' ;
2123import { CommunityDataService } from '../../../../core/data/community-data.service' ;
2224import { RemoteData } from '../../../../core/data/remote-data' ;
@@ -32,12 +34,6 @@ import {
3234 isNotUndefined ,
3335} from '../../../empty.util' ;
3436import { NotificationsService } from '../../../notifications/notifications.service' ;
35- import { RequestParam } from '../../../../core/cache/models/request-param.model' ;
36- import { RequestService } from '../../../../core/data/request.service' ;
37- import { Collection } from '../../../../core/shared/collection.model' ;
38- import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service' ;
39- import { of } from 'rxjs/internal/observable/of' ;
40- import { getHomePageRoute } from '../../../../app-routing-paths' ;
4137
4238/**
4339 * Component representing the create page for communities and collections
@@ -118,7 +114,6 @@ export class CreateComColPageComponent<TDomain extends Collection | Community> i
118114 ) ;
119115 } ) ,
120116 mergeMap ( ( dsoRD : TDomain ) => {
121- this . isLoading$ . next ( false ) ;
122117 if ( isNotUndefined ( dsoRD ) ) {
123118 this . newUUID = dsoRD . uuid ;
124119 if ( uploader . queue . length > 0 ) {
@@ -127,21 +122,23 @@ export class CreateComColPageComponent<TDomain extends Collection | Community> i
127122 tap ( ( href : string ) => {
128123 uploader . options . url = href ;
129124 uploader . onCompleteAll = ( ) => {
125+ this . isLoading$ . next ( false ) ;
130126 this . navigateToNewPage ( ) ;
131127 this . notificationsService . success ( null , this . translate . get ( this . type . value + '.create.notifications.success' ) ) ;
132128 } ;
133129 uploader . uploadAll ( ) ;
134130 } ) ,
135- map ( ( ) => false )
131+ map ( ( ) => false ) ,
136132 ) ;
137133 } else {
138134 this . dsoDataService . refreshCache ( dsoRD ) ;
139135 return of ( true ) ;
140136 }
141137 }
142- } )
138+ } ) ,
143139 ) . subscribe ( ( notify : boolean ) => {
144140 if ( notify ) {
141+ this . isLoading$ . next ( false ) ;
145142 this . navigateToNewPage ( ) ;
146143 this . notificationsService . success ( null , this . translate . get ( this . type . value + '.create.notifications.success' ) ) ;
147144 }
0 commit comments