Skip to content

Commit 3504c44

Browse files
committed
Add start of phone debug for config
1 parent 12a6368 commit 3504c44

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/pkjs/app.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
11
var Clay = require('pebble-clay');
22
var clayConfig = require('./config');
33
var clay = new Clay(clayConfig);
4+
5+
// override send config, in case want to modify (change types) values or debug
6+
Pebble.addEventListener('webviewclosed', function(e) {
7+
if (e && !e.response) {
8+
return;
9+
}
10+
11+
var dict = clay.getSettings(e.response);
12+
//console.log(dict.VIBRATE_ON_DISCONNECT);
13+
14+
console.log('string config data length=' + JSON.stringify(e).length);
15+
// Send settings values to watch side
16+
Pebble.sendAppMessage(dict, function(e) {
17+
console.log('Sent config data to Pebble');
18+
}, function(e) {
19+
console.log('Failed to send config data!');
20+
console.log(JSON.stringify(e)); // NOTE possibly secret leakage if adding secrets to config
21+
});
22+
});

0 commit comments

Comments
 (0)