58789: Preventing submit from firing multiple times + some code cleanup

This commit is contained in:
Kristof De Langhe
2019-01-22 13:51:57 +01:00
parent 27f3f9c7a1
commit 2f853f09b9
2 changed files with 4 additions and 8 deletions

View File

@@ -5,7 +5,7 @@ import { RemoteData } from '../../../core/data/remote-data';
import { PaginatedList } from '../../../core/data/paginated-list';
import { MetadataSchema } from '../../../core/metadata/metadataschema.model';
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
import { map } from 'rxjs/operators';
import { map, take } from 'rxjs/operators';
import { hasValue } from '../../../shared/empty.util';
import { RestResponse } from '../../../core/cache/response.models';
import { zip } from 'rxjs/internal/observable/zip';
@@ -70,7 +70,7 @@ export class MetadataRegistryComponent {
}
deleteSchemas() {
this.registryService.getSelectedMetadataSchemas().subscribe(
this.registryService.getSelectedMetadataSchemas().pipe(take(1)).subscribe(
(schemas) => {
const tasks$ = [];
for (const schema of schemas) {