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

Commit d0f7b31

Browse files
committed
Merge pull request #131 from Microsoft/restart_bug
Fixing immediate restart
2 parents d1c6054 + b31ea8b commit d0f7b31

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

CodePush.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
"use strict";
2-
31
import { AcquisitionManager as Sdk } from "code-push/script/acquisition-sdk";
42
import { Alert } from "./AlertAdapter";
53
import requestFetchAdapter from "./request-fetch-adapter";
@@ -19,18 +17,20 @@ async function checkForUpdate(deploymentKey = null) {
1917
* different from the CodePush update they have already installed.
2018
*/
2119
const nativeConfig = await getConfiguration();
20+
2221
/*
2322
* If a deployment key was explicitly provided,
2423
* then let's override the one we retrieved
2524
* from the native-side of the app. This allows
2625
* dynamically "redirecting" end-users at different
2726
* deployments (e.g. an early access deployment for insiders).
2827
*/
29-
const config = deploymentKey ? { ...nativeConfig, ...{ deploymentKey } }
30-
: nativeConfig;
28+
const config = deploymentKey ? { ...nativeConfig, ...{ deploymentKey } } : nativeConfig;
3129
const sdk = getPromisifiedSdk(requestFetchAdapter, config);
30+
3231
// Use dynamically overridden getCurrentPackage() during tests.
3332
const localPackage = await module.exports.getCurrentPackage();
33+
3434
/*
3535
* If the app has a previously installed update, and that update
3636
* was targetted at the same app version that is currently running,
@@ -43,6 +43,7 @@ async function checkForUpdate(deploymentKey = null) {
4343
? localPackage
4444
: { appVersion: config.appVersion };
4545
const update = await sdk.queryUpdateWithCurrentPackage(queryPackage);
46+
4647
/*
4748
* There are three cases where checkForUpdate will resolve to null:
4849
* ----------------------------------------------------------------

package-mixins.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
"use strict";
2-
31
import { DeviceEventEmitter } from "react-native";
42

53
// This function is used to augment remote and local
@@ -40,7 +38,7 @@ module.exports = (NativeCodePush) => {
4038
await NativeCodePush.installUpdate(this, installMode);
4139
updateInstalledCallback && updateInstalledCallback();
4240
if (installMode == NativeCodePush.codePushInstallModeImmediate) {
43-
NativeCodePush.restartApp();
41+
NativeCodePush.restartApp(false);
4442
} else {
4543
localPackage.isPending = true; // Mark the package as pending since it hasn't been applied yet
4644
}

request-fetch-adapter.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
"use strict";
2-
31
module.exports = {
42
async request(verb, url, body, callback) {
53
if (typeof body === "function") {
@@ -30,4 +28,4 @@ module.exports = {
3028
callback(err);
3129
}
3230
}
33-
};
31+
};

0 commit comments

Comments
 (0)