diff options
author | Alexey 'Cluster' Avdyukhin <ClusterM@users.noreply.github.com> | 2015-04-24 03:42:00 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <ClusterM@users.noreply.github.com> | 2015-04-24 03:42:00 +0300 |
commit | 94a773fdd79cb62de4f0393d90fd47b28c1f6d47 (patch) | |
tree | a3fbc1126b39cbbcf224e12ce019f77a50678dba | |
parent | 10dd1f670c901e0e82cd4af5fda4ecdbdad63a7a (diff) |
Compatibility fix
-rw-r--r-- | src/js/pebble-js-app.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/js/pebble-js-app.js b/src/js/pebble-js-app.js index dea2037..018cb40 100644 --- a/src/js/pebble-js-app.js +++ b/src/js/pebble-js-app.js @@ -21,12 +21,18 @@ Pebble.addEventListener("ready", function() { } }); -Pebble.addEventListener("showConfiguration", function() { - console.log("showing configuration"); - var cfg = '?config=' + encodeURI(JSON.stringify(options)); - var watch = Pebble.getActiveWatchInfo(); +Pebble.addEventListener("showConfiguration", function() { + var cfg = '?config=' + encodeURI(JSON.stringify(options)); + try + { + var watch = Pebble.getActiveWatchInfo(); + } catch(e) { + console.log("getActiveWatchInfo error: " + e); + var watch = null; + } var platform = "&platform=" + ((watch != null) ? watch.platform : "unknown"); - Pebble.openURL("http://clusterrr.com/pebble_configs/mario.php" + cfg + platform); + console.log("showing configuration"); + Pebble.openURL("http://clusterrr.com/pebble_configs/mario.php" + cfg + platform); }); Pebble.addEventListener("webviewclosed", function(e) { |