Skip to content

Commit b7d454f

Browse files
committed
[DURACOM-235] fix refactored after merge
1 parent 78e8fab commit b7d454f

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@ import { TranslateService } from '@ngx-translate/core';
77
import {
88
BehaviorSubject,
99
Observable,
10+
of,
1011
} from 'rxjs';
1112
import {
13+
map,
1214
mergeMap,
1315
take,
16+
tap,
1417
} from 'rxjs/operators';
1518

19+
import { getHomePageRoute } from '../../../../app-routing-paths';
1620
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
1721
import { RequestParam } from '../../../../core/cache/models/request-param.model';
18-
import { Observable } from 'rxjs';
19-
import { map, mergeMap, take, tap } from 'rxjs/operators';
2022
import { ComColDataService } from '../../../../core/data/comcol-data.service';
2123
import { CommunityDataService } from '../../../../core/data/community-data.service';
2224
import { RemoteData } from '../../../../core/data/remote-data';
@@ -32,12 +34,6 @@ import {
3234
isNotUndefined,
3335
} from '../../../empty.util';
3436
import { 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

Comments
 (0)