File tree 1 file changed +7
-0
lines changed
client/modules/IDE/components
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ export class FileNode extends React.Component {
67
67
validateFileName ( ) {
68
68
const oldFileExtension = this . originalFileName . match ( / \. [ 0 - 9 a - z ] + $ / i) ;
69
69
const newFileExtension = this . props . name . match ( / \. [ 0 - 9 a - z ] + $ / i) ;
70
+ const newFileName = this . props . name ;
70
71
if ( oldFileExtension && ! newFileExtension ) {
71
72
this . props . updateFileName ( this . props . id , this . originalFileName ) ;
72
73
}
@@ -77,6 +78,12 @@ export class FileNode extends React.Component {
77
78
) {
78
79
this . props . updateFileName ( this . props . id , this . originalFileName ) ;
79
80
}
81
+ if ( newFileName === '' ) {
82
+ this . props . updateFileName ( this . props . id , this . originalFileName ) ;
83
+ }
84
+ if ( newFileName === newFileExtension [ 0 ] ) {
85
+ this . props . updateFileName ( this . props . id , this . originalFileName ) ;
86
+ }
80
87
}
81
88
82
89
toggleFileOptions ( e ) {
You can’t perform that action at this time.
0 commit comments