1
- "use strict" ;
2
-
3
1
import { AcquisitionManager as Sdk } from "code-push/script/acquisition-sdk" ;
4
2
import { Alert } from "./AlertAdapter" ;
5
3
import requestFetchAdapter from "./request-fetch-adapter" ;
@@ -19,18 +17,20 @@ async function checkForUpdate(deploymentKey = null) {
19
17
* different from the CodePush update they have already installed.
20
18
*/
21
19
const nativeConfig = await getConfiguration ( ) ;
20
+
22
21
/*
23
22
* If a deployment key was explicitly provided,
24
23
* then let's override the one we retrieved
25
24
* from the native-side of the app. This allows
26
25
* dynamically "redirecting" end-users at different
27
26
* deployments (e.g. an early access deployment for insiders).
28
27
*/
29
- const config = deploymentKey ? { ...nativeConfig , ...{ deploymentKey } }
30
- : nativeConfig ;
28
+ const config = deploymentKey ? { ...nativeConfig , ...{ deploymentKey } } : nativeConfig ;
31
29
const sdk = getPromisifiedSdk ( requestFetchAdapter , config ) ;
30
+
32
31
// Use dynamically overridden getCurrentPackage() during tests.
33
32
const localPackage = await module . exports . getCurrentPackage ( ) ;
33
+
34
34
/*
35
35
* If the app has a previously installed update, and that update
36
36
* was targetted at the same app version that is currently running,
@@ -43,6 +43,7 @@ async function checkForUpdate(deploymentKey = null) {
43
43
? localPackage
44
44
: { appVersion : config . appVersion } ;
45
45
const update = await sdk . queryUpdateWithCurrentPackage ( queryPackage ) ;
46
+
46
47
/*
47
48
* There are three cases where checkForUpdate will resolve to null:
48
49
* ----------------------------------------------------------------
0 commit comments