From aa456010fbae4239cf1265f74edc6265d8b92162 Mon Sep 17 00:00:00 2001 From: Geoffrey Goh Date: Tue, 7 Jun 2016 18:37:03 -0700 Subject: [PATCH 1/2] Update CodePush.js --- CodePush.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CodePush.js b/CodePush.js index 253e1c9..72aa6e1 100644 --- a/CodePush.js +++ b/CodePush.js @@ -354,7 +354,11 @@ async function syncInternal(options = {}, syncStatusChangeCallback, downloadProg const dialogButtons = [{ text: null, onPress: async () => { - resolve(await doDownloadAndInstall()); + try { + resolve(await doDownloadAndInstall()); + } catch (downloadError) { + reject(downloadError); + } } }]; @@ -451,4 +455,4 @@ if (NativeCodePush) { log("The CodePush module doesn't appear to be properly installed. Please double-check that everything is setup correctly."); } -module.exports = CodePush; \ No newline at end of file +module.exports = CodePush; From 44ba85dab86d1de67539bf5338dfcfd5427f7ed5 Mon Sep 17 00:00:00 2001 From: Geoffrey Goh Date: Wed, 8 Jun 2016 10:50:56 -0700 Subject: [PATCH 2/2] Update CodePush.js --- CodePush.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/CodePush.js b/CodePush.js index 72aa6e1..92190bf 100644 --- a/CodePush.js +++ b/CodePush.js @@ -353,12 +353,9 @@ async function syncInternal(options = {}, syncStatusChangeCallback, downloadProg let message = null; const dialogButtons = [{ text: null, - onPress: async () => { - try { - resolve(await doDownloadAndInstall()); - } catch (downloadError) { - reject(downloadError); - } + onPress:() => { + doDownloadAndInstall() + .then(resolve, reject); } }];