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

Commit a1727fa

Browse files
committed
Merge pull request #41 from Microsoft/fix_regressions
Fixing appstoreversion regression
2 parents 2705e42 + b00532f commit a1727fa

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

CodePush.ios.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,24 @@ function checkForUpdate() {
9494
return new Promise((resolve, reject) => {
9595
sdk.queryUpdateWithCurrentPackage(queryPackage, (err, update) => {
9696
if (err) {
97-
reject(err);
97+
return reject(err);
9898
}
9999

100-
if (update) {
101-
update = extend(update, packageMixins.remote);
102-
103-
NativeCodePush.isFailedUpdate(update.packageHash)
104-
.then((isFailedHash) => {
105-
update.failedApply = isFailedHash;
106-
resolve(update);
107-
})
108-
.catch(reject)
109-
.done();
110-
} else {
111-
resolve(update);
100+
// Ignore updates that require a newer app version,
101+
// since the end-user couldn't reliably apply it
102+
if (!update || update.updateAppVersion) {
103+
return resolve(null);
112104
}
105+
106+
update = extend(update, packageMixins.remote);
107+
108+
NativeCodePush.isFailedUpdate(update.packageHash)
109+
.then((isFailedHash) => {
110+
update.failedApply = isFailedHash;
111+
resolve(update);
112+
})
113+
.catch(reject)
114+
.done();
113115
})
114116
});
115117
});

0 commit comments

Comments
 (0)