Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
lesleyjanenorton committed Oct 8, 2024
1 parent 05f197d commit 2941f55
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
6 changes: 5 additions & 1 deletion src/background/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class Main {
this.proxyHandler
);
tabHandler = new TabHandler(this, this.extController, this.proxyHandler);
toolbarIconHandler = new ToolbarIconHandler(this, this.extController, this.vpnController);
toolbarIconHandler = new ToolbarIconHandler(
this,
this.extController,
this.vpnController
);
tabReloader = new TabReloader(this, this.proxyHandler);

async init() {
Expand Down
14 changes: 6 additions & 8 deletions src/background/toolbarIconHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
FirefoxVPNState,
} from "./extensionController/index.js";


/**
* ToolbarIconHandler updates the browserAction (toolbar) icon
* to reflect the VPN client's status and updates the icon in
Expand All @@ -23,7 +22,7 @@ export class ToolbarIconHandler extends Component {
constructor(receiver, extController, vpnController) {
super(receiver);
this.extController = extController;
this.vpnController = vpnController
this.vpnController = vpnController;
}

/** @type {FirefoxVPNState | undefined} */
Expand All @@ -39,7 +38,7 @@ export class ToolbarIconHandler extends Component {

this.vpnController.state.subscribe((s) => {
this.vpnState = s;
this.maybeUpdateBrowserActionIcon()
this.maybeUpdateBrowserActionIcon();
});

// Listen for darkmode/lightmode changes and update the browserAction icon
Expand All @@ -66,11 +65,10 @@ export class ToolbarIconHandler extends Component {
? "light"
: "dark";


let status = ["Connecting", "Enabled"].includes(this.extState.state)
? "enabled"
: "disabled";

let status = ["Connecting", "Enabled"].includes(this.extState.state)
? "enabled"
: "disabled";

const stability = this.vpnState?.connectionHealth;

if (!stability || stability == "Stable") {
Expand Down

0 comments on commit 2941f55

Please sign in to comment.