[js][android][ios][storage] uploadTask.on now correctly receives a success status event
This commit is contained in:
parent
c83ba8b756
commit
bdf588e0e2
|
@ -356,6 +356,7 @@ public class RNFirebaseStorage extends ReactContextBaseJavaModule {
|
|||
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
|
||||
Log.d(TAG, "putFile success " + taskSnapshot);
|
||||
WritableMap resp = getUploadTaskAsMap(taskSnapshot);
|
||||
sendJSEvent(STORAGE_STATE_CHANGED, path, resp);
|
||||
sendJSEvent(STORAGE_UPLOAD_SUCCESS, path, resp);
|
||||
resp = getUploadTaskAsMap(taskSnapshot);
|
||||
promise.resolve(resp);
|
||||
|
|
|
@ -349,6 +349,7 @@ RCT_EXPORT_METHOD(putFile:(NSString *) path localPath:(NSString *)localPath meta
|
|||
[uploadTask observeStatus:FIRStorageTaskStatusSuccess handler:^(FIRStorageTaskSnapshot *snapshot) {
|
||||
// upload completed successfully
|
||||
NSDictionary *resp = [self getUploadTaskAsDictionary:snapshot];
|
||||
[self sendJSEvent:STORAGE_EVENT path:path title:STORAGE_STATE_CHANGED props:resp];
|
||||
[self sendJSEvent:STORAGE_EVENT path:path title:STORAGE_UPLOAD_SUCCESS props:resp];
|
||||
resolve(resp);
|
||||
}];
|
||||
|
|
|
@ -122,7 +122,7 @@ export default class StorageTask {
|
|||
return this._subscribe.bind(this);
|
||||
}
|
||||
|
||||
return this._subscribe(event, nextOrObserver, error, complete);
|
||||
return this._subscribe(nextOrObserver, error, complete);
|
||||
}
|
||||
|
||||
pause() {
|
||||
|
|
Loading…
Reference in New Issue