fixed typo in expectedBytes

This commit is contained in:
Elad Gil
2018-06-26 18:01:45 +03:00
parent 318a54e225
commit 7d79cb095e
3 changed files with 3 additions and 3 deletions
@@ -264,7 +264,7 @@ public class RNBackgroundDownloadModule extends ReactContextBaseJavaModule imple
params.putString("id", config.id);
if (!config.reportedBegin) {
params.putInt("expctedBytes", (int)download.getTotal());
params.putInt("expectedBytes", (int)download.getTotal());
ee.emit("downloadBegin", params);
config.reportedBegin = true;
} else {
+1 -1
View File
@@ -33,7 +33,7 @@ RNBackgroundDownloadEmitter.addListener('downloadFailed', event => {
RNBackgroundDownloadEmitter.addListener('downloadBegin', event => {
let task = tasksMap.get(event.id);
if (task) {
task._onBegin(event.expctedBytes);
task._onBegin(event.expectedBytes);
}
});
+1 -1
View File
@@ -211,7 +211,7 @@ RCT_EXPORT_METHOD(checkForExistingDownloads: (RCTPromiseResolveBlock)resolve rej
RNBGDTaskConfig *taskCofig = taskToConfigMap[downloadTask];
if (taskCofig != nil) {
if (!taskCofig.reportedBegin) {
[self sendEventWithName:@"downloadBegin" body:@{@"id": taskCofig.id, @"expctedBytes": [NSNumber numberWithLongLong: totalBytesExpectedToWrite]}];
[self sendEventWithName:@"downloadBegin" body:@{@"id": taskCofig.id, @"expectedBytes": [NSNumber numberWithLongLong: totalBytesExpectedToWrite]}];
urlToConfigMap[downloadTask.currentRequest.URL.absoluteString] = taskCofig;
[[NSUserDefaults standardUserDefaults] setObject:[self serialize: urlToConfigMap] forKey:URL_TO_CONFIG_MAP_KEY];
taskCofig.reportedBegin = YES;