From fe9d75be8edb914f5c36525d63406a0f8b29e839 Mon Sep 17 00:00:00 2001 From: ghalestrilo Date: Thu, 16 Apr 2020 13:08:30 -0300 Subject: [PATCH] :bug: fix filename allowing empty/invalid strings --- client/modules/IDE/components/FileNode.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/modules/IDE/components/FileNode.jsx b/client/modules/IDE/components/FileNode.jsx index df27c136..882b2070 100644 --- a/client/modules/IDE/components/FileNode.jsx +++ b/client/modules/IDE/components/FileNode.jsx @@ -49,7 +49,7 @@ export class FileNode extends React.Component { } get updatedName() { - return this.state.updatedName || this.props.name; + return this.state.updatedName; } commitFileNameChange() { @@ -92,7 +92,6 @@ export class FileNode extends React.Component { const hasOnlyExtension = newFileExtension && newFileName === newFileExtension[0]; if (hasEmptyFilename || hasNoExtension || notSameExtension || hasOnlyExtension || hasExtensionIfFolder) { this.setState({ updatedName: this.originalFileName }); - this.props.updateFileName(this.props.id, this.originalFileName); } else this.commitFileNameChange(); }