mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-05-14 02:14:52 +08:00
work on issues from comments
-remove restartAllowed -add logging to RestartManager -keep track of pending restarts
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user