Updated 'cancel' for zip-writer

Bryan Roe committed Aug 18, 2020 at 11:10 UTC 87fc5eb459cd4cb82b86599582457b9ea7db5fb9
1 file changed +3 -2
agents/meshcore.js
+3 -2
@@ -2161,12 +2161,13 @@ function createMeshCore(agent) {
2161 this.xws.write(Buffer.from(JSON.stringify({ action: 'dialogmessage', msg: null })));
2162 this.xws.write(Buffer.from(JSON.stringify({ action: 'refresh' })));
2163 });
2164 - var zip = require('zip-writer').write({ files: p });
2165 - zip.pipe(out);
2164 + this.zip = require('zip-writer').write({ files: p });
2165 + this.zip.pipe(out);
2166 break;
2167 case 'cancel':
2168 // TODO: Cancel zip operation if present
2169 //sendConsoleText('Cancel operation');
2170 + this.zip.cancel(function () { sendConsoleText('Zip operation was cancelled'); });
2171 break;
2172 default:
2173 // Unknown action, ignore it.