From 99d2cdb9b711539c7cd0a8b90aae1711109b01a4 Mon Sep 17 00:00:00 2001 From: Matias Pando Date: Fri, 17 Apr 2015 12:23:40 -0300 Subject: [PATCH] Fixing barcode scanner (Android) with new cordova plugin --- src/js/init.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/js/init.js b/src/js/init.js index aee1a4841..7179a3ccc 100644 --- a/src/js/init.js +++ b/src/js/init.js @@ -4,7 +4,7 @@ angular.element(document).ready(function() { // Run copayApp after device is ready. var startAngular = function() { - angular.bootstrap(document, ['copayApp']); + angular.bootstrap(document, ['copayApp']); }; /* Cordova specific Init */ if (window.cordova !== undefined) { @@ -25,7 +25,9 @@ angular.element(document).ready(function() { }, false); document.addEventListener('resume', function() { - window.location = '#/cordova/resume'; + if (!window.ignoreMobilePause) { + window.location = '#/cordova/resume'; + } setTimeout(function() { window.ignoreMobilePause = false; }, 100); @@ -34,7 +36,7 @@ angular.element(document).ready(function() { // We are not emitting here, since when the BWS socket reconnects, // update will be triggered document.addEventListener('offline', function() { - window.location = '#/cordova/offline'; + window.location = '#/cordova/offline'; }, false); // // document.addEventListener("online", function() {