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

Commit cfdf1a2

Browse files
committed
update exchange files example
1 parent 5e8f328 commit cfdf1a2

File tree

1 file changed

+17
-4
lines changed
  • examples/exchange-files-in-browser/public/js

1 file changed

+17
-4
lines changed

examples/exchange-files-in-browser/public/js/app.js

+17-4
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,25 @@ function start () {
3232
if (!node) {
3333
updateView('starting', node)
3434

35-
// DEV: To test with latest js-ipfs
35+
const options = {
36+
repo: 'ipfs-' + Math.random(),
37+
config: {
38+
Addresses: {
39+
Swarm: [
40+
// '/dns4/wrtc-star.discovery.libp2p.io/wss/p2p-webrtc-star'
41+
'/dns4/ws-star.discovery.libp2p.io/wss/p2p-websocket-star'
42+
]
43+
}
44+
}
45+
}
46+
47+
// IFDEV: To test with latest js-ipfs
3648
const IPFS = require('ipfs')
37-
node = new IPFS({ repo: 'ipfs-' + Math.random() })
49+
node = new IPFS(options)
50+
// VEDIF
3851

3952
// EXAMPLE
40-
// node = new self.Ipfs({ repo: 'ipfs-' + Math.random() })
53+
// node = new self.Ipfs(options)
4154

4255
node.once('start', () => node.id((err, id) => {
4356
if (err) { return onError(err) }
@@ -121,7 +134,7 @@ function onDrop (event) {
121134

122135
const files = []
123136
for (let i = 0; i < filesDropped.length; i++) {
124-
files.pUsh(filesDropped[i])
137+
files.push(filesDropped[i])
125138
}
126139

127140
files.forEach((file) => {

0 commit comments

Comments
 (0)