Skip to content

Commit

Permalink
fix: support ipfs.add and ipfs.files.add
Browse files Browse the repository at this point in the history
Fixup for #651
+ console log to indicate what is happening
  • Loading branch information
lidel committed Jan 8, 2019
1 parent 0a93780 commit a403af3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion add-on/src/lib/ipfs-client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ function easeApiChanges (ipfs) {
// https://github.com/ipfs/js-ipfs/releases/tag/v0.34.0-pre.0
const movedToTop = ['add', 'addPullStream', 'addReadableStream', 'cat', 'catPullStream', 'catReadableStream', 'get', 'getPullStream', 'getReadableStream']
movedToTop.forEach(cmd => {
if (typeof ipfs[cmd] !== 'function' && ipfs.files && ipfs.files[cmd] === 'function') {
if (typeof ipfs[cmd] !== 'function' && ipfs.files && typeof ipfs.files[cmd] === 'function') {
ipfs[cmd] = ipfs.files[cmd]
console.log(`[ipfs-companion] fixed missing ipfs.${cmd}: added an alias for ipfs.files.${cmd}`)
}
})
}
Expand Down

0 comments on commit a403af3

Please sign in to comment.