Skip to content

Commit

Permalink
FXVPN-246 Restore "open vpn" buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
strseb committed Jan 13, 2025
1 parent 70c10ea commit efad058
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/background/vpncontroller/states.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const REQUEST_TYPES = [
"session_stop",
"interventions",
"settings",
"start",
];

export class VPNState {
Expand Down
15 changes: 13 additions & 2 deletions src/components/prefab-screens.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ const sendToApp = (customElement, command = "") => {
);
};

const openVPN = (elm) => {
sendToApp(elm, "start");
};

const openAuth = (elm) => {
sendToApp(elm, "focus");
sendToApp(elm, "openAuth");
};

const defineMessageScreen = (
args = {
tag,
Expand Down Expand Up @@ -104,6 +113,8 @@ defineMessageScreen({
img: "message-signin.svg",
heading: tr("headerSignedOut"),
bodyText: tr("bodySignedOut"),
primaryAction: tr("btnOpenVpn"),
onPrimaryAction: openAuth,
secondaryAction: tr("getHelp"),
onSecondaryAction: () => closeAfter(() => open(getHelpUrl)),
});
Expand All @@ -128,8 +139,8 @@ defineMessageScreen({
img: "message-open.svg",
heading: tr("headerOpenMozillaVPN"),
bodyText: html` <p>${tr("bodyOpenMsg")}</p> `,
onPrimaryAction: null,
primaryAction: null,
onPrimaryAction: openVPN,
primaryAction: tr("btnOpenVpn"),
secondaryAction: tr("getHelp"),
onSecondaryAction: () => closeAfter(() => open(getHelpUrl)),
});
Expand Down

0 comments on commit efad058

Please sign in to comment.