1- "use strict" ;
2-
31import { AcquisitionManager as Sdk } from "code-push/script/acquisition-sdk" ;
42import { Alert } from "./AlertAdapter" ;
53import 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 * ----------------------------------------------------------------
0 commit comments