work on issues from comments

-remove restartAllowed
-add logging to RestartManager
-keep track of pending restarts
This commit is contained in:
danielbasedow
2016-05-23 21:59:44 +02:00
parent 3ffa986670
commit 1a49e760cb
4 changed files with 22 additions and 16 deletions

View File

@@ -3,6 +3,7 @@ import { Alert } from "./AlertAdapter";
import requestFetchAdapter from "./request-fetch-adapter";
import { AppState, Platform } from "react-native";
import RestartManager from "./RestartManager";
import log from './logging';
let NativeCodePush = require("react-native").NativeModules.CodePush;
const PackageMixins = require("./package-mixins")(NativeCodePush);
@@ -155,11 +156,6 @@ function getPromisifiedSdk(requestFetchAdapter, config) {
return sdk;
}
/* Logs messages to console with the [CodePush] prefix */
function log(message) {
console.log(`[CodePush] ${message}`)
}
// This ensures that notifyApplicationReadyInternal is only called once
// in the lifetime of this module instance.
const notifyApplicationReady = (() => {
@@ -411,7 +407,6 @@ if (NativeCodePush) {
sync,
disallowRestart: RestartManager.disallow,
allowRestart: RestartManager.allow,
restartAllowed: RestartManager.allowed,
InstallMode: {
IMMEDIATE: NativeCodePush.codePushInstallModeImmediate, // Restart the app immediately
ON_NEXT_RESTART: NativeCodePush.codePushInstallModeOnNextRestart, // Don't artificially restart the app. Allow the update to be "picked up" on the next app restart