File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
packages/app/src/app/pages/Sandbox/Editor/Workspace/Files/DirectoryEntry/Entry Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ function EditIcons({
3939 { ( hovering || ( window . __isTouch && active ) || forceShow ) && (
4040 < Container >
4141 { onEdit && (
42- < Tooltip title = "Edit " >
42+ < Tooltip title = "Rename " >
4343 < Icon onClick = { handleClick ( onEdit ) } >
4444 < EditIcon />
4545 </ Icon >
Original file line number Diff line number Diff line change @@ -41,11 +41,13 @@ class Entry extends React.PureComponent {
4141 this . setState ( { error : isInvalidTitle } ) ;
4242 } ;
4343
44- handleRename = ( title , force ) => {
45- const { shortid } = this . props ;
46- const canRename = ! this . handleValidateTitle ( title ) ;
44+ handleRename = ( newTitle , force ) => {
45+ const { shortid, title } = this . props
46+ if ( newTitle === title ) return
47+
48+ const canRename = ! this . handleValidateTitle ( newTitle ) ;
4749 if ( canRename && this . props . rename ) {
48- this . props . rename ( shortid , title ) ;
50+ this . props . rename ( shortid , newTitle ) ;
4951 this . resetState ( ) ;
5052 } else if ( force ) this . resetState ( ) ;
5153 } ;
You can’t perform that action at this time.
0 commit comments