react-native-code-push
Advanced tools
Comparing version 1.2.0-beta to 1.2.1-beta
'use strict'; | ||
var extend = require("extend"); | ||
var NativeCodePush = require("react-native").NativeModules.CodePush; | ||
@@ -106,3 +105,3 @@ var requestFetchAdapter = require("./request-fetch-adapter.js"); | ||
update = extend(update, packageMixins.remote); | ||
update = Object.assign(update, packageMixins.remote); | ||
@@ -214,3 +213,9 @@ NativeCodePush.isFailedUpdate(update.packageHash) | ||
else if (syncOptions.updateDialog) { | ||
syncOptions.updateDialog = Object.assign(CodePush.DEFAULT_UPDATE_DIALOG, syncOptions.updateDialog); | ||
// updateDialog supports any truthy value (e.g. true, "goo", 12), | ||
// but we should treat a non-object value as just the default dialog | ||
if (typeof syncOptions.updateDialog !== "object") { | ||
syncOptions.updateDialog = CodePush.DEFAULT_UPDATE_DIALOG; | ||
} else { | ||
syncOptions.updateDialog = Object.assign({}, CodePush.DEFAULT_UPDATE_DIALOG, syncOptions.updateDialog); | ||
} | ||
@@ -238,3 +243,6 @@ var message = null; | ||
text: syncOptions.updateDialog.optionalIgnoreButtonLabel, | ||
onPress: () => resolve(CodePush.SyncStatus.UPDATE_IGNORED) | ||
onPress: () => { | ||
syncStatusChangeCallback(CodePush.SyncStatus.UPDATE_IGNORED); | ||
resolve(CodePush.SyncStatus.UPDATE_IGNORED); | ||
} | ||
}); | ||
@@ -250,3 +258,3 @@ } | ||
syncStatusChangeCallback(CodePush.SyncStatus.AWAITING_USER_ACTION); | ||
AlertIOS.alert(syncOptions.updateTitle, message, dialogButtons); | ||
AlertIOS.alert(syncOptions.updateDialog.title, message, dialogButtons); | ||
} else { | ||
@@ -295,6 +303,6 @@ doDownloadAndInstall(); | ||
optionalUpdateMessage: "An update is available. Would you like to install it?", | ||
updateTitle: "Update available", | ||
title: "Update available" | ||
} | ||
}; | ||
module.exports = CodePush; | ||
module.exports = CodePush; |
@@ -1,2 +0,1 @@ | ||
var extend = require("extend"); | ||
var { NativeAppEventEmitter } = require("react-native"); | ||
@@ -28,3 +27,3 @@ | ||
downloadProgressSubscription && downloadProgressSubscription.remove(); | ||
return extend({}, downloadedPackage, local); | ||
return Object.assign({}, downloadedPackage, local); | ||
}) | ||
@@ -31,0 +30,0 @@ .catch((error) => { |
{ | ||
"name": "react-native-code-push", | ||
"version": "1.2.0-beta", | ||
"version": "1.2.1-beta", | ||
"description": "React Native plugin for the CodePush service", | ||
@@ -19,4 +19,3 @@ "main": "CodePush.ios.js", | ||
"dependencies": { | ||
"code-push": "^1.1.1-beta", | ||
"extend": "3.0.0" | ||
"code-push": "^1.1.1-beta" | ||
}, | ||
@@ -23,0 +22,0 @@ "devDependencies": { |
@@ -203,3 +203,3 @@ # React Native plugin for CodePush | ||
* __optionalUpdateMessage__ (String) - The text used as the body of an update notification, when the update is optional. Defaults to `"An update is available. Would you like to install it?"`. | ||
* __updateTitle__ (String) - The text used as the header of an update notification that is displayed to the end-user. Defaults to `"Update available"`. | ||
* __title__ (String) - The text used as the header of an update notification that is displayed to the end-user. Defaults to `"Update available"`. | ||
@@ -206,0 +206,0 @@ In addition, the method also recieves two function arguments which serve as event handlers which are called at various points in the sync process: |
79469
1
362
- Removedextend@3.0.0
- Removedextend@3.0.0(transitive)