mirror of
https://github.com/status-im/react-native-cameraroll.git
synced 2025-01-12 19:04:13 +00:00
fix warning about async CameraRoll.getPhotos
Differential Revision: D3065326 fb-gh-sync-id: fea016f0f14078d61d4becf9f9bcbca4fe1f1d92 shipit-source-id: fea016f0f14078d61d4becf9f9bcbca4fe1f1d92
This commit is contained in:
parent
20ca4fb88b
commit
282df26c19
@ -135,9 +135,9 @@ class CameraRoll {
|
||||
'CameraRoll.saveImageWithTag tag must be a valid string.'
|
||||
);
|
||||
if (arguments.length > 1) {
|
||||
console.warn("CameraRoll.saveImageWithTag(tag, success, error) is deprecated. Use the returned Promise instead");
|
||||
let successCallback = arguments[1];
|
||||
let errorCallback = arguments[2] || ( () => {} );
|
||||
console.warn('CameraRoll.saveImageWithTag(tag, success, error) is deprecated. Use the returned Promise instead');
|
||||
const successCallback = arguments[1];
|
||||
const errorCallback = arguments[2] || ( () => {} );
|
||||
RCTCameraRollManager.saveImageWithTag(tag).then(successCallback, errorCallback);
|
||||
return;
|
||||
}
|
||||
@ -157,10 +157,10 @@ class CameraRoll {
|
||||
getPhotosParamChecker({params}, 'params', 'CameraRoll.getPhotos');
|
||||
}
|
||||
if (arguments.length > 1) {
|
||||
console.warn("CameraRoll.getPhotos(tag, success, error) is deprecated. Use the returned Promise instead");
|
||||
console.warn('CameraRoll.getPhotos(tag, success, error) is deprecated. Use the returned Promise instead');
|
||||
let successCallback = arguments[1];
|
||||
if (__DEV__) {
|
||||
let callback = arguments[1];
|
||||
const callback = arguments[1];
|
||||
successCallback = (response) => {
|
||||
getPhotosReturnChecker(
|
||||
{response},
|
||||
@ -170,7 +170,7 @@ class CameraRoll {
|
||||
callback(response);
|
||||
};
|
||||
}
|
||||
let errorCallback = arguments[2] || ( () => {} );
|
||||
const errorCallback = arguments[2] || ( () => {} );
|
||||
RCTCameraRollManager.getPhotos(params).then(successCallback, errorCallback);
|
||||
}
|
||||
// TODO: Add the __DEV__ check back in to verify the Promise result
|
||||
|
Loading…
x
Reference in New Issue
Block a user