Unverified Commit b9f73858 authored by bunsenstraat's avatar bunsenstraat Committed by GitHub

Merge pull request #1360 from ethereum/bunsenstraat-patch-1-1

prevent recreating directories after deleting a file in a deleted directory
parents 02427032 d95a0404
......@@ -266,8 +266,8 @@ const removePath = (root, path: string, pathName, files) => {
return Array.isArray(cur) ? [...acc, ...cur] : [...acc, cur]
}, [])
const prevFiles = _.get(files, _path)
prevFiles && prevFiles.child && prevFiles.child[pathName] && delete prevFiles.child[pathName]
if (prevFiles) {
prevFiles.child && prevFiles.child[pathName] && delete prevFiles.child[pathName]
files = _.set(files, _path, {
isDirectory: true,
path,
......@@ -275,6 +275,7 @@ const removePath = (root, path: string, pathName, files) => {
type: extractNameFromKey(path).indexOf('gist-') === 0 ? 'gist' : 'folder',
child: prevFiles ? prevFiles.child : {}
})
}
return files
}
......
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