From ef28ae61bade928f1a8ab417576bd22c5d1cd2a8 Mon Sep 17 00:00:00 2001 From: Nikolay Demyankov Date: Tue, 29 Dec 2015 15:25:02 +0100 Subject: [PATCH] Fix for https://github.com/nordnet/cordova-hot-code-push/issues/72 --- .../src/com/nordnetab/chcp/main/HotCodePushPlugin.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/android/src/com/nordnetab/chcp/main/HotCodePushPlugin.java b/src/android/src/com/nordnetab/chcp/main/HotCodePushPlugin.java index cc6260c7..f80b5bdf 100644 --- a/src/android/src/com/nordnetab/chcp/main/HotCodePushPlugin.java +++ b/src/android/src/com/nordnetab/chcp/main/HotCodePushPlugin.java @@ -251,7 +251,8 @@ public void run() { }); // fetch update when we are initialized - if (chcpXmlConfig.isAutoDownloadIsAllowed()) { + if (chcpXmlConfig.isAutoDownloadIsAllowed() && + !UpdatesInstaller.isInstalling() && !UpdatesLoader.isExecuting()) { fetchUpdate(null); } } @@ -507,7 +508,10 @@ public void onEvent(AssetsInstalledEvent event) { PluginResult result = PluginResultHelper.pluginResultFromEvent(event); sendMessageToDefaultCallback(result); - fetchUpdate(null); + if (chcpXmlConfig.isAutoDownloadIsAllowed() && + !UpdatesInstaller.isInstalling() && !UpdatesLoader.isExecuting()) { + fetchUpdate(null); + } } /**