From e50271cbe36ca6d51919fc3673506e24de1aafb4 Mon Sep 17 00:00:00 2001 From: Jiajie Zhu Date: Fri, 18 Mar 2016 10:20:07 -0700 Subject: [PATCH] fix warning about async CameraRoll.getPhotos Differential Revision: D3065326 fb-gh-sync-id: fea016f0f14078d61d4becf9f9bcbca4fe1f1d92 shipit-source-id: fea016f0f14078d61d4becf9f9bcbca4fe1f1d92 --- Libraries/CameraRoll/CameraRoll.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Libraries/CameraRoll/CameraRoll.js b/Libraries/CameraRoll/CameraRoll.js index 8f9cc1bc6186ad..a4f0d7fd67a52b 100644 --- a/Libraries/CameraRoll/CameraRoll.js +++ b/Libraries/CameraRoll/CameraRoll.js @@ -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