From 26905461139ad1820180b6d8e5035c5526973bbd Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Tue, 18 Aug 2020 11:10:21 -0700 Subject: [PATCH] Updated 'cancel' for zip-writer --- agents/meshcore.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/agents/meshcore.js b/agents/meshcore.js index 524394a5..cb8e3836 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -2161,12 +2161,13 @@ function createMeshCore(agent) { this.xws.write(Buffer.from(JSON.stringify({ action: 'dialogmessage', msg: null }))); this.xws.write(Buffer.from(JSON.stringify({ action: 'refresh' }))); }); - var zip = require('zip-writer').write({ files: p }); - zip.pipe(out); + this.zip = require('zip-writer').write({ files: p }); + this.zip.pipe(out); break; case 'cancel': // TODO: Cancel zip operation if present //sendConsoleText('Cancel operation'); + this.zip.cancel(function () { sendConsoleText('Zip operation was cancelled'); }); break; default: // Unknown action, ignore it.