@@ -42,7 +42,7 @@ public class RNZipArchiveModule extends ReactContextBaseJavaModule {
4242 private static final String PROGRESS_EVENT_NAME = "zipArchiveProgressEvent" ;
4343 private static final String EVENT_KEY_FILENAME = "filePath" ;
4444 private static final String EVENT_KEY_PROGRESS = "progress" ;
45-
45+
4646 public RNZipArchiveModule (ReactApplicationContext reactContext ) {
4747 super (reactContext );
4848 }
@@ -371,9 +371,9 @@ public void run() {
371371
372372 File f = new File (fileOrDirectory );
373373
374- int totalFiles = 0 ;
374+ int totalFiles = 0 ;
375375 int fileCounter = 0 ;
376-
376+
377377 if (f .exists ()) {
378378 if (f .isDirectory ()) {
379379
@@ -386,23 +386,21 @@ public void run() {
386386 updateProgress (fileCounter , totalFiles , destDirectory );
387387 for (int i = 0 ; i < files .size (); i ++) {
388388 if (files .get (i ).isDirectory ()) {
389- zipFile .addFolder (f .getAbsolutePath (), parameters );
390- fileCounter += 1 ;
391- updateProgress (fileCounter , totalFiles , destDirectory );
389+ zipFile .addFolder (files .get (i ).getAbsolutePath (), parameters );
392390 }
393391 else {
394392 zipFile .addFile (files .get (i ), parameters );
395- fileCounter += 1 ;
396- updateProgress (fileCounter , totalFiles , destDirectory );
397393 }
398- }
399-
400- } else {
401- totalFiles = 1 ;
402- zipFile .addFile (f , parameters );
403394 fileCounter += 1 ;
404- updateProgress (fileCounter , totalFiles , destDirectory );
395+ updateProgress (fileCounter , totalFiles , destDirectory );
405396 }
397+
398+ } else {
399+ totalFiles = 1 ;
400+ zipFile .addFile (f , parameters );
401+ fileCounter += 1 ;
402+ updateProgress (fileCounter , totalFiles , destDirectory );
403+ }
406404 }
407405 else {
408406 promise .reject (null , "File or folder does not exist" );
0 commit comments