mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-05-22 07:52:14 +08:00
Fix return value for get update metadata (#864)
* Fixed issue with error on parsing plist path See https://github.com/Microsoft/react-native-code-push/issues/534#issuecomment-302069326 for details * Changed return value to null for getUpdateMetadata instead of empty string In accordance with docs and https://github.com/Microsoft/react-native-code-push/issues/862
This commit is contained in:
@@ -321,7 +321,7 @@ public class CodePushNativeModule extends ReactContextBaseJavaModule {
|
|||||||
JSONObject currentPackage = mUpdateManager.getCurrentPackage();
|
JSONObject currentPackage = mUpdateManager.getCurrentPackage();
|
||||||
|
|
||||||
if (currentPackage == null) {
|
if (currentPackage == null) {
|
||||||
promise.resolve("");
|
promise.resolve(null);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,14 +335,14 @@ public class CodePushNativeModule extends ReactContextBaseJavaModule {
|
|||||||
if (updateState == CodePushUpdateState.PENDING.getValue() && !currentUpdateIsPending) {
|
if (updateState == CodePushUpdateState.PENDING.getValue() && !currentUpdateIsPending) {
|
||||||
// The caller wanted a pending update
|
// The caller wanted a pending update
|
||||||
// but there isn't currently one.
|
// but there isn't currently one.
|
||||||
promise.resolve("");
|
promise.resolve(null);
|
||||||
} else if (updateState == CodePushUpdateState.RUNNING.getValue() && currentUpdateIsPending) {
|
} else if (updateState == CodePushUpdateState.RUNNING.getValue() && currentUpdateIsPending) {
|
||||||
// The caller wants the running update, but the current
|
// The caller wants the running update, but the current
|
||||||
// one is pending, so we need to grab the previous.
|
// one is pending, so we need to grab the previous.
|
||||||
JSONObject previousPackage = mUpdateManager.getPreviousPackage();
|
JSONObject previousPackage = mUpdateManager.getPreviousPackage();
|
||||||
|
|
||||||
if (previousPackage == null) {
|
if (previousPackage == null) {
|
||||||
promise.resolve("");
|
promise.resolve(null);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user