15407: Simplifies code handling workflow json mounts.
[arvados.git] / src / store / collection-panel / collection-panel-files / collection-panel-files-state.ts
index 8c5ebd72936a5d60e0714589e33b6635187b47bd..9d5b06cea6b9c94f74e5fadbebd022b5b6366178 100644 (file)
@@ -37,9 +37,7 @@ export const mergeCollectionPanelFilesStates = (oldState: CollectionPanelFilesSt
 };
 
 export const filterCollectionFilesBySelection = (tree: CollectionPanelFilesState, selected: boolean) => {
-    const allFiles = getNodeDescendants('')(tree)
-        .map(id => getNodeValue(id)(tree))
-        .filter(file => file !== undefined) as Array<CollectionPanelDirectory | CollectionPanelFile>;
+    const allFiles = getNodeDescendants('')(tree).map(node => node.value);
 
     const selectedDirectories = allFiles.filter(file => file.selected === selected && file.type === CollectionFileType.DIRECTORY);
     const selectedFiles = allFiles.filter(file => file.selected === selected && !selectedDirectories.some(dir => dir.id === file.path));