Commit 61451b4d authored by Smári McCarthy's avatar Smári McCarthy
Browse files

No foreach!

parent 2bddfd3a
......@@ -50,10 +50,8 @@ function getIPFSFromGunAddr(gunaddr) {
console.log("3. Starting IPFS lookup of: '" + ipfsaddr + "'");
return ipfs.get(ipfsaddr);
}).then(files => {
files.forEach((file) => {
console.log('3.1 Getting a Gun-addressed IPFS-stored file: ' + file.path)
return file.content.toString('utf8')
})
console.log('3.1 Getting a Gun-addressed IPFS-stored file: ' + files[0].path);
return files[0].content.toString('utf8');
}).then(content => {
ipfsContent = content;
console.log("4. All done; ipfsContent is: " + typeof ipfsContent);
......
Supports Markdown
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