aboutsummaryrefslogtreecommitdiff
path: root/companion/index.js
blob: 963fd09edce3b0790f7c0fe7fc5caed55ee4bbb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
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");
  }
}