Skip to content

Commit

Permalink
fix: dns to a dir with escaped characters
Browse files Browse the repository at this point in the history
Closes #1733
  • Loading branch information
lidel committed Apr 15, 2021
1 parent 5f13d34 commit c5dbdcd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class App extends Component {
doUpdateHash: PropTypes.func.isRequired,
doFilesWrite: PropTypes.func.isRequired,
routeInfo: PropTypes.object.isRequired,
filesPathInfo: PropTypes.object,
// Injected by DropTarget
isOver: PropTypes.bool.isRequired
}
Expand All @@ -35,9 +36,9 @@ export class App extends Component {
}

addFiles = async (filesPromise) => {
const { doFilesWrite, doUpdateHash, routeInfo } = this.props
const { doFilesWrite, doUpdateHash, routeInfo, filesPathInfo } = this.props
const isFilesPage = routeInfo.pattern === '/files*'
const addAtPath = isFilesPage ? routeInfo.params.path : '/'
const addAtPath = isFilesPage ? (filesPathInfo?.realPath || routeInfo.params.path) : '/'
const files = await filesPromise

doFilesWrite(normalizeFiles(files), addAtPath)
Expand Down
6 changes: 4 additions & 2 deletions src/bundles/files/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,10 @@ const actions = () => ({
try {
await ipfs.files.cp(src, dst)
} catch (err) {
throw Object.assign(new Error('Folder already exists.'), {
code: 'ERR_FOLDER_EXISTS'
// TODO: Not sure why we do this. Perhaps a generic error is used
// to avoid leaking private information via Countly?
throw Object.assign(new Error('ipfs.files.cp call failed'), {
code: 'ERR_FILES_CP_FAILED'
})
}
}
Expand Down

0 comments on commit c5dbdcd

Please sign in to comment.