interface ProjectPanelDataProps {
currentItemId: string;
- isSidePanelOpen: boolean;
}
interface ProjectPanelActionProps {
& 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;
}
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));
}
}