Skip to content

Commit 4a8f70b

Browse files
committed
fix: switch external API client to ipfs-http-client
Missed import of the old name in external.js
1 parent d5ff013 commit 4a8f70b

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

add-on/src/lib/ipfs-client/external.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict'
22
/* eslint-env browser */
33

4-
const IpfsApi = require('ipfs-api')
4+
const IpfsApi = require('ipfs-http-client')
55

66
exports.init = async function (opts) {
77
console.log('[ipfs-companion] External ipfs init', opts.apiURLString)
@@ -15,4 +15,4 @@ exports.destroy = async function () {
1515
console.log('[ipfs-companion] External ipfs destroy')
1616
}
1717

18-
// TODO: Upgrade to a caching proxy for ipfs-api
18+
// TODO: Upgrade to a caching proxy for ipfs-http-client

add-on/src/lib/ipfs-proxy/pre-mfs-scope.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function prefixSrcDestArgs (prefix, args) {
6363
prefixedArgs[i] = safePathPrefix(prefix, item, isDestination)
6464
} else if (Array.isArray(item)) {
6565
// The syntax recently changed to remove passing an array,
66-
// but we allow for both versions until js-ipfs-api is updated to remove
66+
// but we allow for both versions until js-ipfs-http-client is updated to remove
6767
// support for it
6868
console.warn('[ipfs-companion] use of array in ipfs.files.cp|mv is deprecated, see https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/FILES.md#filescp')
6969
prefixedArgs[i] = prefixSrcDestArgs(prefix, item)

add-on/src/lib/ipfs-request.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function createRequestModifier (getState, dnslinkResolver, ipfsPathValidator, ru
119119
// '403 - Forbidden' fix for Chrome and Firefox
120120
// --------------------------------------------
121121
// We remove Origin header from requests made to API URL
122-
// by js-ipfs-api running in WebExtension context to remove need
122+
// by js-ipfs-http-client running in WebExtension context to remove need
123123
// for manual whitelisting Access-Control-Allow-Origin at go-ipfs
124124
// More info:
125125
// Firefox: https://github.com/ipfs-shipyard/ipfs-companion/issues/622

add-on/src/popup/quick-upload.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async function processFiles (state, emitter, files) {
7474
try {
7575
result = await ipfsCompanion.ipfs.files.add(streams, options)
7676
// This is just an additional safety check, as in past combination
77-
// of specific go-ipfs/js-ipfs-api versions
77+
// of specific go-ipfs/js-ipfs-http-client versions
7878
// produced silent errors in form of partial responses:
7979
// https://github.com/ipfs-shipyard/ipfs-companion/issues/480
8080
const partialResponse = result.length !== streams.length + (options.wrapWithDirectory ? 1 : 0)
@@ -141,7 +141,7 @@ function progressHandler (doneBytes, totalBytes, state, emitter) {
141141
state.progress = `${done.value} ${done.symbol} / ${total.value} ${total.symbol} (${percent}%)`
142142
} else {
143143
// This is a gracefull fallback for environments in which progress reporting is delayed
144-
// until entire file/chunk is bufferend into memory (eg. js-ipfs-api)
144+
// until entire file/chunk is bufferend into memory (eg. js-ipfs-http-client)
145145
state.progress = browser.i18n.getMessage('quickUpload_state_buffering')
146146
}
147147
emitter.emit('render')

0 commit comments

Comments
 (0)