mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-28 04:46:57 -04:00
Account for cases where the Pebble global is undefined
This commit is contained in:
@@ -29,7 +29,11 @@ function Clay(config, customFn, options) {
|
||||
self.config = config;
|
||||
self.customFn = customFn || function() {};
|
||||
self.components = {};
|
||||
self.meta = {};
|
||||
self.meta = {
|
||||
activeWatchInfo: null,
|
||||
accountToken: '',
|
||||
watchToken: ''
|
||||
};
|
||||
|
||||
// Let Clay handle all the magic
|
||||
if (options.autoHandleEvents !== false && typeof Pebble !== 'undefined') {
|
||||
@@ -63,7 +67,7 @@ function Clay(config, customFn, options) {
|
||||
* @return {void}
|
||||
*/
|
||||
function _populateMeta() {
|
||||
self.meta = !Pebble ? {} : {
|
||||
self.meta = {
|
||||
activeWatchInfo: Pebble.getActiveWatchInfo && Pebble.getActiveWatchInfo(),
|
||||
accountToken: Pebble.getAccountToken(),
|
||||
watchToken: Pebble.getWatchToken()
|
||||
|
||||
Reference in New Issue
Block a user