From b49dc8e631f5d92d3e7a68d2a5c36fa7bf257ae8 Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Wed, 5 Feb 2020 20:21:59 +1100 Subject: [PATCH] fix: Making Promise return types consistent across iOS and Android, updating types to match. (#137) --- .../com/reactnativecommunity/cameraroll/CameraRollModule.java | 2 +- typings/CameraRoll.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java b/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java index e320ba4d5..e3be3a11a 100644 --- a/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java +++ b/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java @@ -594,7 +594,7 @@ public class CameraRollModule extends ReactContextBaseJavaModule { cursor.close(); if (deletedCount == mUris.size()) { - mPromise.resolve(null); + mPromise.resolve(true); } else { mPromise.reject(ERROR_UNABLE_TO_DELETE, "Could not delete all media, only deleted " + deletedCount + " photos."); diff --git a/typings/CameraRoll.d.ts b/typings/CameraRoll.d.ts index 576ce196d..cdab97c72 100644 --- a/typings/CameraRoll.d.ts +++ b/typings/CameraRoll.d.ts @@ -75,7 +75,7 @@ declare namespace CameraRoll { /** * Delete a photo from the camera roll or media library. photoUris is an array of photo uri's. */ - function deletePhotos(photoUris: Array): void; + function deletePhotos(photoUris: Array): Promise; /** * Saves the photo or video to the camera roll or photo library.