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

Commit 777b9b6

Browse files
author
Will Anderson
committed
Properly wrap sdk.queryUpdateWithCurrentPackage in a promise
1 parent 5432964 commit 777b9b6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

CodePush.ios.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var getSdk = (() => {
4646
}
4747
})();
4848

49-
function checkForUpdate(callback) {
49+
function checkForUpdate() {
5050
var config;
5151
var sdk;
5252
return getConfiguration()
@@ -64,7 +64,12 @@ function checkForUpdate(callback) {
6464
queryPackage = localPackage;
6565
}
6666

67-
sdk.queryUpdateWithCurrentPackage(queryPackage, callback);
67+
return new Promise((resolve, reject) => {
68+
sdk.queryUpdateWithCurrentPackage(queryPackage, (err, update) => {
69+
if (err) return reject(err);
70+
resolve(update);
71+
});
72+
});
6873
});
6974
}
7075

0 commit comments

Comments
 (0)