Commit 245d14e1 authored by martin hou's avatar martin hou

fix: 使用self引用

parent 80f5033d
...@@ -294,9 +294,9 @@ function Jensen(log, conn) { ...@@ -294,9 +294,9 @@ function Jensen(log, conn) {
self.timewait = cmd.command == TRANSFER_FILE || cmd.command == GET_FILE_BLOCK ? 1000 : 10; self.timewait = cmd.command == TRANSFER_FILE || cmd.command == GET_FILE_BLOCK ? 1000 : 10;
console.log(pid + '-send', data); console.log(pid + '-send', data);
if (this.onprogress && (cmd.command == TRANSFER_FILE || cmd.command == GET_FILE_BLOCK)) if (self.onprogress && (cmd.command == TRANSFER_FILE || cmd.command == GET_FILE_BLOCK))
{ {
try { this.onprogress(0); } catch(e) { } try { self.onprogress(0); } catch(e) { }
} }
await device.transferOut(1, data).catch((e) => crash('sendNext', e)); await device.transferOut(1, data).catch((e) => crash('sendNext', e));
if (cmd.onprogress) cmd.onprogress(1, 1); if (cmd.onprogress) cmd.onprogress(1, 1);
......
Markdown is supported
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