restoring using currentId
authorPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Mon, 6 Aug 2018 13:05:51 +0000 (15:05 +0200)
committerPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Mon, 6 Aug 2018 13:05:51 +0000 (15:05 +0200)
Feature #13905

Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>

src/views/project-panel/project-panel.tsx

index 63a57bbddb4ba7714feada5897ff6f133876fec2..0cd75ca3f8f5ae5e14fd5b853d48a624bd45c0cc 100644 (file)
@@ -129,7 +129,6 @@ export const PROJECT_PANEL_ID = "projectPanel";
 
 interface ProjectPanelDataProps {
     currentItemId: string;
-    isSidePanelOpen: boolean;
 }
 
 interface ProjectPanelActionProps {
@@ -145,7 +144,7 @@ type ProjectPanelProps = ProjectPanelDataProps & ProjectPanelActionProps & Dispa
     & WithStyles<CssRules> & RouteComponentProps<{ id: string }>;
 
 export const ProjectPanel = withStyles(styles)(
-    connect((state: RootState) => ({ currentItemId: state.projects.currentItemId, isSidePanelOpen: state.sidePanel[0].open }))(
+    connect((state: RootState) => ({ currentItemId: state.projects.currentItemId }))(
         class extends React.Component<ProjectPanelProps> {
             render() {
                 const { classes } = this.props;
@@ -186,7 +185,7 @@ export const ProjectPanel = withStyles(styles)(
             }
 
             componentDidMount() {
-                if (this.props.match.params.id && !this.props.isSidePanelOpen) {
+                if (this.props.match.params.id && this.props.currentItemId === '') {
                     this.props.dispatch<any>(restoreBranch(this.props.match.params.id));
                 }
             }