mirror of
https://github.com/chinchang/web-maker.git
synced 2025-05-07 11:05:18 +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) {
|
||||
// If we get a new Item, clear file buffers and currently selected file.
|
||||
if (
|
||||
this.props.currentItem.createdOn !== nextProps.currentItem.createdOn ||
|
||||
this.props.currentItem.id !== nextProps.currentItem.id
|
||||
@ -59,6 +60,8 @@ export default class ContentWrapFiles extends Component {
|
||||
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 (
|
||||
nextProps.currentItem.files !== this.props.currentItem.files &&
|
||||
this.state.selectedFile &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user