Commit a0de18e9 authored by ioedeveloper's avatar ioedeveloper Committed by GitHub

Set border and update message for same file/folder

parent d35003b5
...@@ -339,7 +339,12 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -339,7 +339,12 @@ export const FileExplorer = (props: FileExplorerProps) => {
try { try {
const exists = await fileManager.exists(dirName) const exists = await fileManager.exists(dirName)
if (exists) return if (exists) {
return modal('Rename File Failed', `A file or folder ${extractNameFromKey(newFolderPath)} already exists at this location. Please choose a different name.`, {
label: 'Close',
fn: () => {}
}, null)
}
await fileManager.mkdir(dirName) await fileManager.mkdir(dirName)
setState(prevState => { setState(prevState => {
return { ...prevState, focusElement: [{ key: newFolderPath, type: 'folder' }] } return { ...prevState, focusElement: [{ key: newFolderPath, type: 'folder' }] }
...@@ -379,7 +384,7 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -379,7 +384,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
const exists = await fileManager.exists(newPath) const exists = await fileManager.exists(newPath)
if (exists) { if (exists) {
modal('Rename File Failed', 'File name already exists', { modal('Rename File Failed', `A file or folder ${extractNameFromKey(newPath)} already exists at this location. Please choose a different name.`, {
label: 'Close', label: 'Close',
fn: () => {} fn: () => {}
}, null) }, null)
...@@ -894,8 +899,8 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -894,8 +899,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
const labelClass = state.focusEdit.element === file.path const labelClass = state.focusEdit.element === file.path
? 'bg-light' : state.focusElement.findIndex(item => item.key === file.path) !== -1 ? 'bg-light' : state.focusElement.findIndex(item => item.key === file.path) !== -1
? 'bg-secondary' : state.mouseOverElement === file.path ? 'bg-secondary' : state.mouseOverElement === file.path
? 'bg-secondary' : (state.focusContext.element === file.path) && (state.focusEdit.element !== file.path) ? 'bg-light border' : (state.focusContext.element === file.path) && (state.focusEdit.element !== file.path)
? 'bg-secondary' : '' ? 'bg-light border' : ''
if (file.isDirectory) { if (file.isDirectory) {
return ( return (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment