From cdfed5ae3889a95f988427fd2ed9eef3f0d7fbc9 Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Fri, 31 Aug 2018 06:37:25 +0300 Subject: [PATCH] obj fix --- src/background/p2p.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/background/p2p.js b/src/background/p2p.js index 32b7d9b..0fdeb1d 100644 --- a/src/background/p2p.js +++ b/src/background/p2p.js @@ -132,7 +132,7 @@ class p2p { }); }); - this.on('file', (path, callback) => { + this.on('file', ({path}, callback) => { const readable = new fs.ReadStream(path) logT('transfer', 'server transfer file', path) readable.on('data', (chunk) => { @@ -382,7 +382,7 @@ class p2p { file(peer, path) { const fileStream = fs.createWriteStream(path) - let deleteCallback = peer.emit('file', path, (chunk) => { + let deleteCallback = peer.emit('file', {path}, (chunk) => { if(!chunk) { logT('transfer', 'closing transfering file stream', path)