X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/83cc752d85a910c19ffaf5c74433fbf7fa76e038..e44d47bdea01e25926f4f3ff750f2d1cb4fd8204:/src/store/collections/collection-copy-actions.ts diff --git a/src/store/collections/collection-copy-actions.ts b/src/store/collections/collection-copy-actions.ts index b13d08aa..cf87f3f1 100644 --- a/src/store/collections/collection-copy-actions.ts +++ b/src/store/collections/collection-copy-actions.ts @@ -28,13 +28,9 @@ export const copyCollection = (resource: CopyFormDialogData) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { dispatch(startSubmit(COLLECTION_COPY_FORM_NAME)); try { - dispatch(progressIndicatorActions.START_WORKING(COLLECTION_COPY_FORM_NAME)); const collection = await services.collectionService.get(resource.uuid); - const uuidKey = 'uuid'; - delete collection[uuidKey]; const newCollection = await services.collectionService.create({ ...collection, ownerUuid: resource.ownerUuid, name: resource.name }); dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_COPY_FORM_NAME })); - dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_COPY_FORM_NAME)); return newCollection; } catch (e) { const error = getCommonResourceServiceError(e); @@ -47,7 +43,8 @@ export const copyCollection = (resource: CopyFormDialogData) => dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_COPY_FORM_NAME })); throw new Error('Could not copy the collection.'); } - dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_COPY_FORM_NAME)); return; + } finally { + dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_COPY_FORM_NAME)); } };