2
0
mirror of synced 2025-01-11 06:35:51 +00:00

[ios][storage] fixes #15, fixed an issue where some storage errors are unserializable by RN - workaround is just to send nil instead of the NSError

This commit is contained in:
Salakar 2017-03-23 00:37:38 +00:00
parent f1655c1ea6
commit 67a2b41a61

View File

@ -80,7 +80,12 @@ RCT_EXPORT_MODULE(RNFirebaseStorage);
break; break;
} }
reject(code, message, error); if (userInfo != nil && [userInfo objectForKey:@"data"]) {
// errors with 'data' are unserializable - it breaks react so we send nil instead
reject(code, message, nil);
} else {
reject(code, message, error);
}
} }
@ -367,7 +372,7 @@ RCT_EXPORT_METHOD(putFile:(NSString *) path localPath:(NSString *)localPath meta
return @{ return @{
@"bytesTransferred": @(task.progress.completedUnitCount), @"bytesTransferred": @(task.progress.completedUnitCount),
@"ref": task.reference.fullPath, @"ref": task.reference.fullPath,
@"status": [self getTaskStatus:task.status], @"state": [self getTaskStatus:task.status],
@"totalBytes": @(task.progress.totalUnitCount) @"totalBytes": @(task.progress.totalUnitCount)
}; };
} }