Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libre
Samizdat
Commits
61451b4d
Commit
61451b4d
authored
Sep 16, 2019
by
Smári McCarthy
Browse files
No foreach!
parent
2bddfd3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
service-worker.js
View file @
61451b4d
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment