Skip to content
This repository has been archived by the owner on Feb 18, 2019. It is now read-only.

Commit

Permalink
fix warning about async CameraRoll.getPhotos
Browse files Browse the repository at this point in the history
Differential Revision: D3065326

fb-gh-sync-id: fea016f0f14078d61d4becf9f9bcbca4fe1f1d92
shipit-source-id: fea016f0f14078d61d4becf9f9bcbca4fe1f1d92
  • Loading branch information
zjj010104 authored and Facebook Github Bot 1 committed Mar 18, 2016
1 parent a6ada1e commit e50271c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Libraries/CameraRoll/CameraRoll.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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},
Expand All @@ -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
Expand Down

0 comments on commit e50271c

Please sign in to comment.