summaryrefslogtreecommitdiffhomepage
path: root/gui/src
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2020-04-21 16:00:36 +0200
committerOskar Nyberg <oskar@mullvad.net>2020-04-21 16:00:36 +0200
commit106937e21d66b19a9a291e7014b9f81a412e9933 (patch)
tree111eff60bf18dd8421f7ea19901ce7b52f82e255 /gui/src
parent171530b04a5fdbc8c27fa4f29ee37a98545ab335 (diff)
parent3526d44121d07b4ea1a4098f1d33d7b6bee43b17 (diff)
downloadmullvadvpn-106937e21d66b19a9a291e7014b9f81a412e9933.tar.xz
mullvadvpn-106937e21d66b19a9a291e7014b9f81a412e9933.zip
Merge branch 'revert-electron-8'
Diffstat (limited to 'gui/src')
-rw-r--r--gui/src/main/index.ts28
-rw-r--r--gui/src/shared/ipc-event-channel.ts4
2 files changed, 2 insertions, 30 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts
index 6f9185688a..c0dd326429 100644
--- a/gui/src/main/index.ts
+++ b/gui/src/main/index.ts
@@ -4,7 +4,6 @@ import log from 'electron-log';
import mkdirp from 'mkdirp';
import moment from 'moment';
import * as path from 'path';
-import { sprintf } from 'sprintf-js';
import * as uuid from 'uuid';
import AccountExpiry from '../shared/account-expiry';
import BridgeSettingsBuilder from '../shared/bridge-settings-builder';
@@ -190,10 +189,6 @@ class ApplicationMain {
this.guiSettings.load();
- // The default value has previously been false but will be changed to true in Electron 9. The
- // false value has been deprecated in Electron 8. This can be removed when Electron 9 is used.
- app.allowRendererProcessReuse = true;
-
app.on('activate', this.onActivate);
app.on('ready', this.onReady);
app.on('window-all-closed', () => app.quit());
@@ -377,7 +372,6 @@ class ApplicationMain {
this.installGenericMenubarAppWindowHandlers(tray, windowController);
this.installLinuxWindowCloseHandler(windowController);
this.setLinuxAppMenu();
- this.setLinuxTrayMenu(tray, windowController);
window.setMenuBarVisibility(false);
break;
default:
@@ -1361,28 +1355,6 @@ class ApplicationMain {
Menu.setApplicationMenu(Menu.buildFromTemplate(template));
}
- private setLinuxTrayMenu(tray: Tray, windowController: WindowController) {
- tray.setContextMenu(
- Menu.buildFromTemplate([
- {
- label: sprintf(
- // TRANSLATORS: The label displayed in the context menu that is opened when the user
- // TRANSLATORS: clicks the icon in the linux system tray/status bar.
- // TRANSLATORS: Available placeholder:
- // TRANSLATORS: %(appname) - Name of the app, i.e. Mullvad VPN
- messages.pgettext('status-icon-menu', 'Open %(appname)s'),
- {
- appname: app.getName(),
- },
- ),
- click: () => {
- windowController.show();
- },
- },
- ]),
- );
- }
-
private addContextMenu(window: BrowserWindow) {
const menuTemplate: Electron.MenuItemConstructorOptions[] = [
{ role: 'cut' },
diff --git a/gui/src/shared/ipc-event-channel.ts b/gui/src/shared/ipc-event-channel.ts
index b6e788e72e..c09b8d2a84 100644
--- a/gui/src/shared/ipc-event-channel.ts
+++ b/gui/src/shared/ipc-event-channel.ts
@@ -446,7 +446,7 @@ function handler<T>(event: string): (handlerFn: (value: T) => void) => void {
type RequestResult<T> = { type: 'success'; value: T } | { type: 'error'; message: string };
-// The Electron API uses the `any` type.
+// The Electron API uses the `any` type.
/* eslint-disable @typescript-eslint/no-explicit-any */
function requestHandler<T>(event: string): (fn: (...args: any[]) => Promise<T>) => void {
return (fn: (...args: any[]) => Promise<T>) => {
@@ -477,7 +477,7 @@ function requestHandler<T>(event: string): (fn: (...args: any[]) => Promise<T>)
}
/* eslint-enable @typescript-eslint/no-explicit-any */
-// The Electron API uses the `any` type.
+// The Electron API uses the `any` type.
/* eslint-disable @typescript-eslint/no-explicit-any */
function requestSender<T>(event: string): (...args: any[]) => Promise<T> {
return (...args: any[]): Promise<T> => {