18169: Removed cancel disable when uploading
[arvados-workbench2.git] / src / store / collections / collection-upload-actions.ts
index 268d5ddfc50c560ae98d74a4b121c5487a5b3a38..0ca681b98ed2fcc9d8550165b477231f58fa0287 100644 (file)
@@ -3,23 +3,25 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { Dispatch } from 'redux';
-import { RootState } from '~/store/store';
-import { ServiceRepository } from '~/services/services';
-import { dialogActions } from '~/store/dialog/dialog-actions';
+import { RootState } from 'store/store';
+import { ServiceRepository } from 'services/services';
+import { dialogActions } from 'store/dialog/dialog-actions';
 import { loadCollectionFiles } from '../collection-panel/collection-panel-files/collection-panel-files-actions';
-import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions';
-import { fileUploaderActions } from '~/store/file-uploader/file-uploader-actions';
+import { snackbarActions, SnackbarKind } from 'store/snackbar/snackbar-actions';
+import { fileUploaderActions } from 'store/file-uploader/file-uploader-actions';
 import { reset, startSubmit, stopSubmit } from 'redux-form';
-import { progressIndicatorActions } from "~/store/progress-indicator/progress-indicator-actions";
-import { collectionPanelFilesAction } from '~/store/collection-panel/collection-panel-files/collection-panel-files-actions';
-import { createTree } from '~/models/tree';
+import { progressIndicatorActions } from "store/progress-indicator/progress-indicator-actions";
+import { collectionPanelFilesAction } from 'store/collection-panel/collection-panel-files/collection-panel-files-actions';
+import { createTree } from 'models/tree';
 import { loadCollectionPanel } from '../collection-panel/collection-panel-action';
+import * as WorkbenchActions from 'store/workbench/workbench-actions';
 
 export const uploadCollectionFiles = (collectionUuid: string) =>
-    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+    async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
         dispatch(fileUploaderActions.START_UPLOAD());
         const files = getState().fileUploader.map(file => file.file);
         await services.collectionService.uploadFiles(collectionUuid, files, handleUploadProgress(dispatch));
+        dispatch(WorkbenchActions.loadCollection(collectionUuid));
         dispatch(fileUploaderActions.CLEAR_UPLOAD());
     };