Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit fcf4cb5

Browse files
committed
revert 4 spaces change
1 parent 44d90db commit fcf4cb5

File tree

2 files changed

+40
-40
lines changed

2 files changed

+40
-40
lines changed

CodePushPackage.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ + (void)downloadPackage:(NSDictionary *)updatePackage
154154
failCallback:(void (^)(NSError *err))failCallback
155155
{
156156
NSString *packageFolderPath = [self getPackageFolderPath:updatePackage[@"packageHash"]];
157-
NSError *error;
157+
NSError *error = nil;
158158

159159
if (![[NSFileManager defaultManager] fileExistsAtPath:packageFolderPath]) {
160160
[[NSFileManager defaultManager] createDirectoryAtPath:packageFolderPath

package-mixins.js

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,47 @@ var extend = require("extend");
22
var { NativeAppEventEmitter } = require("react-native");
33

44
module.exports = (NativeCodePush) => {
5-
var remote = {
6-
abortDownload: function abortDownload() {
7-
return NativeCodePush.abortDownload(this);
8-
},
9-
download: function download(progressHandler) {
10-
if (!this.downloadUrl) {
11-
return Promise.reject(new Error("Cannot download an update without a download url"));
12-
}
5+
var remote = {
6+
abortDownload: function abortDownload() {
7+
return NativeCodePush.abortDownload(this);
8+
},
9+
download: function download(progressHandler) {
10+
if (!this.downloadUrl) {
11+
return Promise.reject(new Error("Cannot download an update without a download url"));
12+
}
1313

14-
var downloadProgressSubscription;
15-
if (progressHandler) {
16-
// Use event subscription to obtain download progress.
17-
downloadProgressSubscription = NativeAppEventEmitter.addListener(
18-
'CodePushDownloadProgress',
19-
progressHandler
20-
);
21-
}
14+
var downloadProgressSubscription;
15+
if (progressHandler) {
16+
// Use event subscription to obtain download progress.
17+
downloadProgressSubscription = NativeAppEventEmitter.addListener(
18+
'CodePushDownloadProgress',
19+
progressHandler
20+
);
21+
}
2222

23-
// Use the downloaded package info. Native code will save the package info
24-
// so that the client knows what the current package version is.
25-
return NativeCodePush.downloadUpdate(this)
26-
.then((downloadedPackage) => {
27-
downloadProgressSubscription && downloadProgressSubscription.remove();
28-
return extend({}, downloadedPackage, local);
29-
})
30-
.catch((error) => {
31-
downloadProgressSubscription && downloadProgressSubscription.remove();
32-
// Rethrow the error for subsequent handlers down the promise chain.
33-
throw error;
34-
});
35-
}
36-
};
23+
// Use the downloaded package info. Native code will save the package info
24+
// so that the client knows what the current package version is.
25+
return NativeCodePush.downloadUpdate(this)
26+
.then((downloadedPackage) => {
27+
downloadProgressSubscription && downloadProgressSubscription.remove();
28+
return extend({}, downloadedPackage, local);
29+
})
30+
.catch((error) => {
31+
downloadProgressSubscription && downloadProgressSubscription.remove();
32+
// Rethrow the error for subsequent handlers down the promise chain.
33+
throw error;
34+
});
35+
}
36+
};
3737

38-
var local = {
39-
apply: function apply(rollbackTimeout = 0, restartImmediately = true) {
40-
return NativeCodePush.applyUpdate(this, rollbackTimeout, restartImmediately);
41-
}
42-
};
38+
var local = {
39+
apply: function apply(rollbackTimeout = 0, restartImmediately = true) {
40+
return NativeCodePush.applyUpdate(this, rollbackTimeout, restartImmediately);
41+
}
42+
};
4343

44-
return {
45-
remote: remote,
46-
local: local
47-
};
44+
return {
45+
remote: remote,
46+
local: local
47+
};
4848
};

0 commit comments

Comments
 (0)