File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,13 @@ @implementation RNZipArchive
2222 resolver:(RCTPromiseResolveBlock)resolve
2323 rejecter:(RCTPromiseRejectBlock)reject)
2424{
25-
25+
2626 [self zipArchiveProgressEvent: 0 total: 1 ]; // force 0%
27-
27+
2828 BOOL success = [SSZipArchive unzipFileAtPath: zipPath toDestination: destinationPath delegate: self ];
29-
29+
3030 [self zipArchiveProgressEvent: 1 total: 1 ]; // force 100%
31-
31+
3232 if (success) {
3333 resolve (destinationPath);
3434 } else {
@@ -42,13 +42,13 @@ @implementation RNZipArchive
4242 resolver:(RCTPromiseResolveBlock)resolve
4343 rejecter:(RCTPromiseRejectBlock)reject)
4444{
45-
45+
4646 [self zipArchiveProgressEvent: 0 total: 1 ]; // force 0%
47-
47+
4848 BOOL success = [SSZipArchive createZipFileAtPath: destinationPath withContentsOfDirectory: zipPath];
49-
49+
5050 [self zipArchiveProgressEvent: 1 total: 1 ]; // force 100%
51-
51+
5252 if (success) {
5353 resolve (destinationPath);
5454 } else {
@@ -61,7 +61,7 @@ - (void)zipArchiveProgressEvent:(NSInteger)loaded total:(NSInteger)total {
6161 if (total == 0 ) {
6262 return ;
6363 }
64-
64+
6565 // TODO: should send the filename, just like the Android version
6666 [self .bridge.eventDispatcher sendAppEventWithName: @" zipArchiveProgressEvent" body: @{
6767 @" progress" : @( (float )loaded / (float )total )
You can’t perform that action at this time.
0 commit comments