[android][storage] fix readable map already consumed error

This commit is contained in:
Salakar 2017-04-07 18:44:46 +01:00
parent bdf588e0e2
commit 90546aa7dd
1 changed files with 4 additions and 0 deletions

View File

@ -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);
}