From e571c2289108bc4c7ff2d1394333d3d99723d42d Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 27 Mar 2019 14:29:45 +0200 Subject: [PATCH] fix(operation) progress --- client/modules/operation/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/modules/operation/index.js b/client/modules/operation/index.js index dfb57db9..989e6017 100644 --- a/client/modules/operation/index.js +++ b/client/modules/operation/index.js @@ -69,7 +69,11 @@ module.exports.init = promisify((callback) => { if (!config('progress') || config('dropbox')) return callback(); - load(initOperations(CloudCmd.prefix, callback)); + const { + prefix, + prefixSocket, + } = CloudCmd; + load(initOperations(prefix, prefixSocket, callback)); }, (callback) => { Loaded = true; @@ -88,8 +92,8 @@ function _authCheck(spawn, ok) { spawn.emit('auth', config('username'), config('password')); } -function _initOperations(socketPrefix, fn) { - const prefix = `${socketPrefix}/fileop`; +function _initOperations(prefix, socketPrefix, fn) { + socketPrefix = `${socketPrefix}/fileop`; fileop({prefix, socketPrefix}, (e, operator) => { fn();