fix project loading bug
This commit is contained in:
parent
74e207553f
commit
b0ce13e6ba
3 changed files with 3 additions and 3 deletions
|
@ -151,7 +151,7 @@ FileNode.propTypes = {
|
||||||
};
|
};
|
||||||
|
|
||||||
function mapStateToProps(state, ownProps) {
|
function mapStateToProps(state, ownProps) {
|
||||||
return state.files.find((file) => file.id === ownProps.id);
|
return state.files.find((file) => file.id === ownProps.id) || { ...ownProps, name: 'test' };
|
||||||
}
|
}
|
||||||
|
|
||||||
function mapDispatchToProps(dispatch) {
|
function mapDispatchToProps(dispatch) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { PropTypes } from 'react';
|
import React, { PropTypes } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import InlineSVG from 'react-inlinesvg';
|
import InlineSVG from 'react-inlinesvg';
|
||||||
import SidebarItem from './SidebarItem';
|
// import SidebarItem from './SidebarItem';
|
||||||
const rightArrowUrl = require('../../../images/right-arrow.svg');
|
const rightArrowUrl = require('../../../images/right-arrow.svg');
|
||||||
const leftArrowUrl = require('../../../images/left-arrow.svg');
|
const leftArrowUrl = require('../../../images/left-arrow.svg');
|
||||||
import ConnectedFileNode from './FileNode';
|
import ConnectedFileNode from './FileNode';
|
||||||
|
|
|
@ -100,7 +100,7 @@ const files = (state, action) => {
|
||||||
}
|
}
|
||||||
return file;
|
return file;
|
||||||
});
|
});
|
||||||
return [...newState, { name: action.name, id: action.id, content: action.content, url: action.url }];
|
return [...newState, { name: action.name, id: action.id, _id: action._id, content: action.content, url: action.url }];
|
||||||
case ActionTypes.SHOW_FILE_OPTIONS:
|
case ActionTypes.SHOW_FILE_OPTIONS:
|
||||||
return state.map(file => {
|
return state.map(file => {
|
||||||
if (file.id !== action.id) {
|
if (file.id !== action.id) {
|
||||||
|
|
Loading…
Reference in a new issue