mirror of
https://github.com/chinchang/web-maker.git
synced 2025-05-08 11:35:16 +02:00
ContentFileWrap: add comments
This commit is contained in:
parent
41ae269d9b
commit
c371409d26
@ -51,6 +51,7 @@ export default class ContentWrapFiles extends Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
componentWillUpdate(nextProps) {
|
componentWillUpdate(nextProps) {
|
||||||
|
// If we get a new Item, clear file buffers and currently selected file.
|
||||||
if (
|
if (
|
||||||
this.props.currentItem.createdOn !== nextProps.currentItem.createdOn ||
|
this.props.currentItem.createdOn !== nextProps.currentItem.createdOn ||
|
||||||
this.props.currentItem.id !== nextProps.currentItem.id
|
this.props.currentItem.id !== nextProps.currentItem.id
|
||||||
@ -59,6 +60,8 @@ export default class ContentWrapFiles extends Component {
|
|||||||
this.state.selectedFile = null;
|
this.state.selectedFile = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the files have changed and we have a selected file (even after previous condition),
|
||||||
|
// update the buffer with new file content (may be it got prettified?)
|
||||||
if (
|
if (
|
||||||
nextProps.currentItem.files !== this.props.currentItem.files &&
|
nextProps.currentItem.files !== this.props.currentItem.files &&
|
||||||
this.state.selectedFile &&
|
this.state.selectedFile &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user