Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 07e4267

Browse files
committed
fix: refs in browser
1 parent 5e5cd59 commit 07e4267

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/components/files-regular/refs-local-pull-stream.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ module.exports = function (self) {
2323
}
2424

2525
function dsKeyToRef (key) {
26-
// Block key is of the form /<base32 encoded string>
27-
const decoder = new base32.Decoder()
28-
const buff = decoder.write(key.toString().slice(1)).finalize()
2926
try {
27+
// Block key is of the form /<base32 encoded string>
28+
const decoder = new base32.Decoder()
29+
const buff = Buffer.from(decoder.write(key.toString().slice(1)).finalize())
3030
return { ref: new CID(buff).toString() }
3131
} catch (err) {
3232
return { err: `Could not convert block with key '${key}' to CID: ${err.message}` }

0 commit comments

Comments
 (0)