diff --git a/android/src/main/java/io/invertase/firebase/storage/RNFirebaseStorage.java b/android/src/main/java/io/invertase/firebase/storage/RNFirebaseStorage.java index dc69551d..1bbd06d6 100644 --- a/android/src/main/java/io/invertase/firebase/storage/RNFirebaseStorage.java +++ b/android/src/main/java/io/invertase/firebase/storage/RNFirebaseStorage.java @@ -357,7 +357,11 @@ public class RNFirebaseStorage extends ReactContextBaseJavaModule { Log.d(TAG, "putFile success " + taskSnapshot); WritableMap resp = getUploadTaskAsMap(taskSnapshot); sendJSEvent(STORAGE_STATE_CHANGED, path, resp); + + // to avoid readable map already consumed errors + resp = getUploadTaskAsMap(taskSnapshot); sendJSEvent(STORAGE_UPLOAD_SUCCESS, path, resp); + resp = getUploadTaskAsMap(taskSnapshot); promise.resolve(resp); }