[ARVADOS-WORKBENCH2] updated: 1.1.4-539-ga819823

Git user git at public.curoverse.com
Tue Aug 7 07:07:27 EDT 2018


Summary of changes:
 .../uploader/collection-uploader-reducer.ts        | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

       via  a8198231beab18f4dd24f7538791a66dd698d028 (commit)
      from  2b95c9dce888f19bdefae5add1f65847da72f1a2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit a8198231beab18f4dd24f7538791a66dd698d028
Author: Daniel Kos <daniel.kos at contractors.roche.com>
Date:   Tue Aug 7 13:07:24 2018 +0200

    Code review fixes
    
    Feature #13856
    
    Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos at contractors.roche.com>

diff --git a/src/store/collections/uploader/collection-uploader-reducer.ts b/src/store/collections/uploader/collection-uploader-reducer.ts
index 9864056..79a8a62 100644
--- a/src/store/collections/uploader/collection-uploader-reducer.ts
+++ b/src/store/collections/uploader/collection-uploader-reducer.ts
@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { CollectionUploaderAction, collectionUploaderActions, UploadFile } from "./collection-uploader-actions";
-import * as _ from 'lodash';
 
 export type CollectionUploaderState = UploadFile[];
 
@@ -25,18 +24,15 @@ export const collectionUploaderReducer = (state: CollectionUploaderState = initi
             const startTime = Date.now();
             return state.map(f => ({...f, startTime, prevTime: startTime}));
         },
-        SET_UPLOAD_PROGRESS: ({ fileId, loaded, total, currentTime }) => {
-            const files = _.cloneDeep(state);
-            const f = files.find(f => f.id === fileId);
-            if (f) {
-                f.prevLoaded = f.loaded;
-                f.loaded = loaded;
-                f.total = total;
-                f.prevTime = f.currentTime;
-                f.currentTime = currentTime;
-            }
-            return files;
-        },
+        SET_UPLOAD_PROGRESS: ({ fileId, loaded, total, currentTime }) =>
+            state.map(f => f.id === fileId ? {
+                ...f,
+                prevLoaded: f.loaded,
+                loaded,
+                total,
+                prevTime: f.currentTime,
+                currentTime
+            } : f),
         CLEAR_UPLOAD: () => [],
         default: () => state
     });

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list