react-native-compressor 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,7 +44,7 @@ public class Utils {
44
44
 
45
45
  @Override
46
46
  public void onError(String errorMessage) {
47
- promise.resolve(srcPath);
47
+ promise.reject("Compression has canncelled");
48
48
  }
49
49
 
50
50
  @Override
@@ -382,20 +382,17 @@ func makeValidUri(filePath: String) -> String {
382
382
 
383
383
  }, completionHandler: { result in
384
384
  self.videoCompressionCounter=0;
385
- switch result {
386
- case .success(let status):
387
- switch status {
385
+ switch exporter.status {
388
386
  case .completed:
389
387
  onCompletion(exporter.outputURL!)
390
388
  break
389
+ case .cancelled:
390
+ let error = CompressionError(message: "Compression has canncelled")
391
+ onFailure(error)
392
+ break
391
393
  default:
392
394
  onCompletion(url)
393
395
  break
394
- }
395
- break
396
- case .failure(let error):
397
- onCompletion(url)
398
- break
399
396
  }
400
397
  })
401
398
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-compressor",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "This library compress image, video and audio",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",