Skip to content

Commit 54e743a

Browse files
authored
Merge pull request processing#3028 from Keshav-0907/extension-renaming-added
Added extension renaming with confirmation
2 parents 64929c9 + 2681f9a commit 54e743a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

client/modules/IDE/components/FileNode.jsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,19 @@ class FileNode extends React.Component {
187187
if (
188188
hasEmptyFilename ||
189189
hasNoExtension ||
190-
notSameExtension ||
191190
hasOnlyExtension ||
192191
hasExtensionIfFolder
193192
) {
194193
this.setUpdatedName(currentName);
194+
} else if (notSameExtension) {
195+
const userResponse = window.confirm(
196+
'Are you sure you want to change the file extension?'
197+
);
198+
if (userResponse) {
199+
this.saveUpdatedFileName();
200+
} else {
201+
this.setUpdatedName(currentName);
202+
}
195203
} else {
196204
this.saveUpdatedFileName();
197205
}

0 commit comments

Comments
 (0)