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

Commit 0b97f4b

Browse files
committed
add new status to docs
1 parent f500e51 commit 0b97f4b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CodePush.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ const sync = (() => {
191191

192192
return (options = {}, syncStatusChangeCallback, downloadProgressCallback) => {
193193
if (syncInProgress) {
194-
typeof syncStatusChangeCallback == "function"
194+
typeof syncStatusChangeCallback === "function"
195195
? syncStatusChangeCallback(CodePush.SyncStatus.SYNC_IN_PROGRESS)
196196
: log("Sync already in progress.");
197197
return Promise.resolve(CodePush.SyncStatus.SYNC_IN_PROGRESS);
@@ -228,7 +228,7 @@ async function syncInternal(options = {}, syncStatusChangeCallback, downloadProg
228228
...options
229229
};
230230

231-
syncStatusChangeCallback = typeof syncStatusChangeCallback == "function"
231+
syncStatusChangeCallback = typeof syncStatusChangeCallback === "function"
232232
? syncStatusChangeCallback
233233
: (syncStatus) => {
234234
switch(syncStatus) {
@@ -267,7 +267,7 @@ async function syncInternal(options = {}, syncStatusChangeCallback, downloadProg
267267
}
268268
};
269269

270-
downloadProgressCallback = typeof downloadProgressCallback == "function"
270+
downloadProgressCallback = typeof downloadProgressCallback === "function"
271271
? downloadProgressCallback
272272
: (downloadProgress) => {
273273
log(`Expecting ${downloadProgress.totalBytes} bytes, received ${downloadProgress.receivedBytes} bytes.`);

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ This method returns a `Promise` which is resolved to a `SyncStatus` code that in
554554
555555
* __codePush.SyncStatus.UPDATE_INSTALLED__ *(6)* - The update has been installed and will be run either immediately after the `syncStatusChangedCallback` function returns or the next time the app resumes/restarts, depending on the `InstallMode` specified in `SyncOptions`.
556556
557-
If the update check and/or the subsequent download fails for any reason, the `Promise` object returned by `sync` will be rejected with the reason.
557+
* __codePush.SyncStatus.SYNC_IN_PROGRESS *(7)* - There is an ongoing `sync` operation running which prevents the current call from being executed.
558558
559559
The `sync` method can be called anywhere you'd like to check for an update. That could be in the `componentWillMount` lifecycle event of your root component, the onPress handler of a `<TouchableHighlight>` component, in the callback of a periodic timer, or whatever else makes sense for your needs. Just like the `checkForUpdate` method, it will perform the network request to check for an update in the background, so it won't impact your UI thread and/or JavaScript thread's responsiveness.
560560
@@ -622,6 +622,7 @@ This enum is provided to the `syncStatusChangedCallback` function that can be pa
622622
* __codePush.SyncStatus.UP_TO_DATE__ *(4)* - The app is fully up-to-date with the configured deployment.
623623
* __codePush.SyncStatus.UPDATE_IGNORED__ *(5)* - The app has an optional update, which the end user chose to ignore. (This is only applicable when the `updateDialog` is used)
624624
* __codePush.SyncStatus.UPDATE_INSTALLED__ *(6)* - An available update has been installed and will be run either immediately after the `syncStatusChangedCallback` function returns or the next time the app resumes/restarts, depending on the `InstallMode` specified in `SyncOptions`.
625+
* __codePush.SyncStatus.SYNC_IN_PROGRESS *(7)* - There is an ongoing `sync` operation running which prevents the current call from being executed.
625626
* __codePush.SyncStatus.UNKNOWN_ERROR__ *(-1)* - The sync operation encountered an unknown error.
626627
627628
### Objective-C API Reference (iOS)

0 commit comments

Comments
 (0)