fix: fix IOS MetaData (#134)
* changes to fix IOS MetaData * chore: fix formatting Co-authored-by: Bartol Karuza <bartol.k@gmail.com>
This commit is contained in:
parent
34444b21b3
commit
e70cff5429
|
@ -140,7 +140,7 @@ RCT_EXPORT_METHOD(saveToCameraRoll:(NSURLRequest *)request
|
||||||
if ([options[@"type"] isEqualToString:@"video"]) {
|
if ([options[@"type"] isEqualToString:@"video"]) {
|
||||||
assetRequest = [PHAssetChangeRequest creationRequestForAssetFromVideoAtFileURL:inputURI];
|
assetRequest = [PHAssetChangeRequest creationRequestForAssetFromVideoAtFileURL:inputURI];
|
||||||
} else {
|
} else {
|
||||||
assetRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:inputImage];
|
assetRequest = [PHAssetChangeRequest creationRequestForAssetFromImageAtFileURL:inputURI];
|
||||||
}
|
}
|
||||||
placeholder = [assetRequest placeholderForCreatedAsset];
|
placeholder = [assetRequest placeholderForCreatedAsset];
|
||||||
if (![options[@"album"] isEqualToString:@""]) {
|
if (![options[@"album"] isEqualToString:@""]) {
|
||||||
|
@ -189,20 +189,8 @@ RCT_EXPORT_METHOD(saveToCameraRoll:(NSURLRequest *)request
|
||||||
};
|
};
|
||||||
|
|
||||||
void (^loadBlock)(void) = ^void() {
|
void (^loadBlock)(void) = ^void() {
|
||||||
if ([options[@"type"] isEqualToString:@"video"]) {
|
|
||||||
inputURI = request.URL;
|
inputURI = request.URL;
|
||||||
saveWithOptions();
|
saveWithOptions();
|
||||||
} else {
|
|
||||||
[[self.bridge moduleForName:@"ImageLoader" lazilyLoadIfNecessary:YES] loadImageWithURLRequest:request callback:^(NSError *error, UIImage *image) {
|
|
||||||
if (error) {
|
|
||||||
reject(kErrorUnableToLoad, nil, error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
inputImage = image;
|
|
||||||
saveWithOptions();
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
requestPhotoLibraryAccess(reject, loadBlock);
|
requestPhotoLibraryAccess(reject, loadBlock);
|
||||||
|
|
Loading…
Reference in New Issue