Skip to content

Commit

Permalink
🐛 Fix PMProgressHandler not getting notified when failed (#1099)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 authored Mar 7, 2024
1 parent dfb1330 commit b487b5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ To know more about breaking changes, see the [Migration Guide][].
### Fixes

- Do not predicate subtypes images as adjusted on Darwin.
- Fix `PMProgressHandler` not getting notified when failed on Darwin.

## 3.0.0

Expand Down
7 changes: 4 additions & 3 deletions ios/Classes/core/PMManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ - (void)fetchLivePhotosFile:(PHAsset *)asset handler:(NSObject <PMResultHandler>
if (error) {
NSLog(@"error = %@", error);
[self notifyProgress:progressHandler progress:0 state:PMProgressStateFailed];
[handler reply:nil];
[handler replyError:[NSString stringWithFormat:@"%@", error]];
} else {
[handler reply:path];
[self notifySuccess:progressHandler];
Expand Down Expand Up @@ -566,7 +566,7 @@ - (void)fetchOriginVideoFile:(PHAsset *)asset handler:(NSObject <PMResultHandler
if (error) {
NSLog(@"error = %@", error);
[self notifyProgress:progressHandler progress:0 state:PMProgressStateFailed];
[handler reply:nil];
[handler replyError:[NSString stringWithFormat:@"%@", error]];
} else {
[handler reply:path];
[self notifySuccess:progressHandler];
Expand Down Expand Up @@ -778,7 +778,8 @@ - (void)fetchOriginImageFile:(PHAsset *)asset resultHandler:(NSObject <PMResultH
completionHandler:^(NSError *_Nullable error) {
if (error) {
NSLog(@"error = %@", error);
[handler reply:nil];
[self notifyProgress:progressHandler progress:0 state:PMProgressStateFailed];
[handler replyError:[NSString stringWithFormat:@"%@", error]];
} else {
[handler reply:path];
[self notifySuccess:progressHandler];
Expand Down

0 comments on commit b487b5d

Please sign in to comment.