From 8c432e4595d6c9d6349e2f3f83970629dcd14823 Mon Sep 17 00:00:00 2001 From: Ian MacLeod Date: Thu, 23 Jun 2016 10:52:35 -0700 Subject: [PATCH 1/2] Bug fix for #379 where status report can be undefined on notifyApplicationReady I introduced a crash on subsequent launches after an update is applied, where `getNewStatusReport()` returns nothing. This fixes it! --- CodePush.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodePush.js b/CodePush.js index f2aac01..288c254 100644 --- a/CodePush.js +++ b/CodePush.js @@ -173,7 +173,7 @@ const notifyApplicationReady = (() => { async function notifyApplicationReadyInternal() { await NativeCodePush.notifyApplicationReady(); const statusReport = await NativeCodePush.getNewStatusReport(); - tryReportStatus(statusReport); // Don't wait for this to complete. + statusReport && tryReportStatus(statusReport); // Don't wait for this to complete. return statusReport; } From 2b628007e0298909e0063e5906cb890cd6ae40aa Mon Sep 17 00:00:00 2001 From: Ian MacLeod Date: Thu, 23 Jun 2016 10:59:00 -0700 Subject: [PATCH 2/2] Indicate that StatusReports are optional, too --- typings/react-native-code-push.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typings/react-native-code-push.d.ts b/typings/react-native-code-push.d.ts index 7867921..cf3bacc 100644 --- a/typings/react-native-code-push.d.ts +++ b/typings/react-native-code-push.d.ts @@ -243,7 +243,7 @@ declare namespace CodePush { /** * Notifies the CodePush runtime that an installed update is considered successful. */ - function notifyAppReady(): Promise; + function notifyAppReady(): Promise; /** * Allow CodePush to restart the app.