summaryrefslogtreecommitdiff
path: root/chrome/content/accountWizard/bitmaskMessengerOverlay.js
blob: aa6bff8ad8de636d0488860657514ee0048c5f26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
window.addEventListener("load", function() {
  overlayStartup();
}, false);

window.setInterval(function() {
  overlayStartup();
}, 3000);

function overlayStartup() {
  let myPanel = document.getElementById("bitmaskStatusBarPanel");

  // We just need to check if bitmaskd is running and if we were able to
  // authorize with it using the token from bitmask.js
  let promise = bitmask.core.status();
  promise.then(function(data) {
    myPanel.label = "bitmask is " + data["mail"];
    myPanel.style.color = "green";
  }, function(error) {
    myPanel.label = "bitmask is not running";
    myPanel.style.color = "red";
    console.log(error);
  });
}