mirror of
https://github.com/chinchang/web-maker.git
synced 2025-08-02 11:30:22 +02:00
contentwrapfiles: handle case of selectedfile getting deleted
This commit is contained in:
@@ -83,6 +83,17 @@ export default class ContentWrapFiles extends Component {
|
|||||||
this.state.selectedFile = null;
|
this.state.selectedFile = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If selectedFile got deleted
|
||||||
|
if (
|
||||||
|
this.state.selectedFile &&
|
||||||
|
!getFileFromPath(
|
||||||
|
nextProps.currentItem.files,
|
||||||
|
this.state.selectedFile.path
|
||||||
|
).file
|
||||||
|
) {
|
||||||
|
this.state.selectedFile = null;
|
||||||
|
}
|
||||||
|
|
||||||
// If the files have changed and we have a selected file (even after previous condition),
|
// 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?)
|
// update the buffer with new file content (may be it got prettified?)
|
||||||
if (
|
if (
|
||||||
|
Reference in New Issue
Block a user