mirror of
https://github.com/zoriya/react-native-background-downloader.git
synced 2026-05-31 09:21:57 +00:00
fixed typo in expectedBytes
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user