aboutsummaryrefslogtreecommitdiff
path: root/companion
diff options
context:
space:
mode:
authorGravatar Frédéric Harper <fharper@fitbit.com> 2018-03-14 19:47:43 -0400
committerGravatar GitHub <noreply@github.com> 2018-03-14 19:47:43 -0400
commit8f19795141c284c79df3fa03841c2d6480520b53 (patch)
tree8bc704d91a87ff9ad879aa1c99d9f64e6dedf0ea /companion
parent6d721d94b0c1e75f80e1d54dcfa976239188b31a (diff)
parent21475330fc2e1de979aa1dc5456accc7ebc84db6 (diff)
Merge pull request #3 from Fitbit/jonb/versa
Updated for Versa
Diffstat (limited to 'companion')
-rw-r--r--companion/index.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/companion/index.js b/companion/index.js
index 963fd09..e4aac6e 100644
--- a/companion/index.js
+++ b/companion/index.js
@@ -3,10 +3,9 @@ import * as messaging from "messaging";
settingsStorage.onchange = function(evt) {
if (messaging.peerSocket.readyState === messaging.peerSocket.OPEN) {
- let data = JSON.parse(evt.newValue);
- messaging.peerSocket.send(data["values"][0].value);
- } else {
- console.log("companion - no connection");
+ if (evt.key === "theme") {
+ let data = JSON.parse(evt.newValue);
+ messaging.peerSocket.send(data["values"][0].value);
+ }
}
}
-