merge master
[arvados.git] / src / views-components / project-tree-picker / project-tree-picker.tsx
index 9139ee7c20c531a65668995b0fbe4245323848f8..86795295c3e0146225d3aad675039b9d2c437e72 100644 (file)
@@ -23,11 +23,13 @@ type ProjectTreePickerProps = Pick<TreePickerProps, 'onContextMenu' | 'toggleIte
 const mapDispatchToProps = (dispatch: Dispatch, props: { onChange: (projectUuid: string) => void }): ProjectTreePickerProps => ({
     onContextMenu: () => { return; },
     toggleItemActive: (nodeId, status, pickerId) => {
-        getNotSelectedTreePickerKind(pickerId)
-            .forEach(pickerId => dispatch(treePickerActions.TOGGLE_TREE_PICKER_NODE_SELECT({ nodeId: '', pickerId })));
-        dispatch(treePickerActions.TOGGLE_TREE_PICKER_NODE_SELECT({ nodeId, pickerId }));
+        if (nodeId !== TreePickerId.FAVORITES && nodeId !== TreePickerId.SHARED_WITH_ME) {
+            getNotSelectedTreePickerKind(pickerId)
+                .forEach(pickerId => dispatch(treePickerActions.TOGGLE_TREE_PICKER_NODE_SELECT({ nodeId: '', pickerId })));
+            dispatch(treePickerActions.TOGGLE_TREE_PICKER_NODE_SELECT({ nodeId, pickerId }));
 
-        props.onChange(nodeId);
+            props.onChange(nodeId);
+        }
     },
     toggleItemOpen: (nodeId, status, pickerId) => {
         dispatch<any>(toggleItemOpen(nodeId, status, pickerId));