aboutsummaryrefslogtreecommitdiff
path: root/companion
diff options
context:
space:
mode:
Diffstat (limited to 'companion')
-rw-r--r--companion/index.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/companion/index.js b/companion/index.js
new file mode 100644
index 0000000..963fd09
--- /dev/null
+++ b/companion/index.js
@@ -0,0 +1,12 @@
+import { settingsStorage } from "settings";
+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");
+ }
+}
+