From 2c3c7c4a2486521bc2ad7ea041b138ebf62ba593 Mon Sep 17 00:00:00 2001 From: Joe Lambert Date: Fri, 24 Apr 2015 16:45:08 +0100 Subject: [PATCH] Fixed a bug with the JavaScript when used with the Device plugin --- www/app-version.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/www/app-version.js b/www/app-version.js index e490f65..f416c82 100644 --- a/www/app-version.js +++ b/www/app-version.js @@ -24,8 +24,9 @@ var exec = require('cordova/exec'); var channel = require('cordova/channel'); var utils = require('cordova/utils'); -// Wait on the CordovaInfoReady event -channel.waitForInitialization('onCordovaInfoReady'); +channel.createSticky('onCordovaAppVersionReady'); +// Wait on the onCordovaAppVersionReady event +channel.waitForInitialization('onCordovaAppVersionReady'); /** * Object representing the app's native version and build number @@ -45,7 +46,7 @@ var RareloopAppVersion = function () { _this.version = info.version; _this.build = parseInt(info.build, 10); - channel.onCordovaInfoReady.fire(); + channel.onCordovaAppVersionReady.fire(); },function(e) { _this.available = false; utils.alert("[ERROR] Error initializing Version Plugin: " + e);