Explorar o código

Небольшая доработка

Book Pauk %!s(int64=2) %!d(string=hai) anos
pai
achega
3877ad15c1
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      server/core/ZipReader.js

+ 4 - 3
server/core/ZipReader.js

@@ -10,13 +10,14 @@ class ZipReader {
             throw new Error('Zip closed');
     }
 
-    async open(zipFile) {
+    async open(zipFile, zipEntries = true) {
         if (this.zip)
             throw new Error('Zip file is already open');
 
          const zip = new StreamZip.async({file: zipFile});
          
-         this.zipEntries = await zip.entries();
+        if (zipEntries)
+            this.zipEntries = await zip.entries();
 
          this.zip = zip;
     }
@@ -49,7 +50,7 @@ class ZipReader {
         if (this.zip) {
             this.zip.close();
             this.zip = null;
-            this.zipEntries = null;
+            this.zipEntries = undefined;
         }
     }
 }