codePushStatusDidChange()

in src/components/codePush.tsx [19:46]


  codePushStatusDidChange(syncStatus) {
    switch (syncStatus) {
      case CodePushLib.SyncStatus.CHECKING_FOR_UPDATE:
        this.setState({ syncMessage: "Checking for update." });
        break;
      case CodePushLib.SyncStatus.DOWNLOADING_PACKAGE:
        this.setState({ syncMessage: "Downloading package." });
        break;
      case CodePushLib.SyncStatus.AWAITING_USER_ACTION:
        this.setState({ syncMessage: "Awaiting user action." });
        break;
      case CodePushLib.SyncStatus.INSTALLING_UPDATE:
        this.setState({ syncMessage: "Installing update." });
        break;
      case CodePushLib.SyncStatus.UP_TO_DATE:
        this.setState({ syncMessage: "App up to date.", progress: null });
        break;
      case CodePushLib.SyncStatus.UPDATE_IGNORED:
        this.setState({ syncMessage: "Update cancelled by user.", progress: null });
        break;
      case CodePushLib.SyncStatus.UPDATE_INSTALLED:
        this.setState({ syncMessage: "Update installed and will be applied on restart.", progress: null });
        break;
      case CodePushLib.SyncStatus.UNKNOWN_ERROR:
        this.setState({ syncMessage: "An unknown error occurred.", progress: null });
        break;
    }
  }