jcesarmobile closed pull request #34: be sure to remove listeners before 
executing start
URL: https://github.com/apache/cordova-plugin-battery-status/pull/34

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/www/battery.js b/www/battery.js
index 242503d..8e28868 100644
--- a/www/battery.js
+++ b/www/battery.js
@@ -57,7 +57,9 @@ function handlers() {
 Battery.onHasSubscribersChange = function() {
   // If we just registered the first handler, make sure native listener is 
   if (this.numHandlers === 1 && handlers() === 1) {
-      exec(battery._status, battery._error, "Battery", "start", []);
+      exec(function() {
+        exec(battery._status, battery._error, "Battery", "start", []);
+      }, battery._error, "Battery", "stop", []);
   } else if (handlers() === 0) {
       exec(null, null, "Battery", "stop", []);


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org
For additional commands, e-mail: commits-h...@cordova.apache.org

Reply via email to