diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2020-01-24 13:45:58 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2020-01-27 18:49:36 +0100 |
| commit | 64abc0312b016e62d64f5be2a5b1f9eaaecd51de (patch) | |
| tree | 5f1604f60c2ced4e4f02f5b698a85d14903f694c | |
| parent | 989b58e5fcef66a0fa018ea3939653c9ed5a7367 (diff) | |
| download | mullvadvpn-64abc0312b016e62d64f5be2a5b1f9eaaecd51de.tar.xz mullvadvpn-64abc0312b016e62d64f5be2a5b1f9eaaecd51de.zip | |
Fix deprecated Electron APIs
| -rw-r--r-- | gui/src/main/index.ts | 9 | ||||
| -rw-r--r-- | gui/src/main/notification-controller.ts | 2 | ||||
| -rw-r--r-- | gui/src/shared/logging.ts | 2 |
3 files changed, 4 insertions, 9 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 0ef641ec15..a335a9f372 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -207,7 +207,7 @@ class ApplicationMain { const appDataDir = process.env.LOCALAPPDATA; if (appDataDir) { app.setPath('appData', appDataDir); - app.setPath('userData', path.join(appDataDir, app.getName())); + app.setPath('userData', path.join(appDataDir, app.name)); } else { throw new Error('Missing %LOCALAPPDATA% environment variable'); } @@ -291,7 +291,7 @@ class ApplicationMain { // quitting the app. // Github issue: https://github.com/electron/electron/issues/15008 if (process.platform === 'darwin' && this.windowController) { - this.windowController.window.setClosable(true); + this.windowController.window.closable = true; } } @@ -1346,11 +1346,6 @@ class ApplicationMain { // disable double click on tray icon since it causes weird delay tray.setIgnoreDoubleClickEvents(true); - // disable icon highlight on macOS - if (process.platform === 'darwin') { - tray.setHighlightMode('never'); - } - return tray; } diff --git a/gui/src/main/notification-controller.ts b/gui/src/main/notification-controller.ts index 99af3bcf45..98852029f3 100644 --- a/gui/src/main/notification-controller.ts +++ b/gui/src/main/notification-controller.ts @@ -11,7 +11,7 @@ export default class NotificationController { private reconnecting = false; private presentedNotifications: { [key: string]: boolean } = {}; private pendingNotifications: Notification[] = []; - private notificationTitle = process.platform === 'linux' ? app.getName() : ''; + private notificationTitle = process.platform === 'linux' ? app.name : ''; private notificationIcon?: NativeImage; constructor() { diff --git a/gui/src/shared/logging.ts b/gui/src/shared/logging.ts index d06abca4fe..4c0af38334 100644 --- a/gui/src/shared/logging.ts +++ b/gui/src/shared/logging.ts @@ -15,7 +15,7 @@ export function getLogsDirectory() { switch (process.platform) { case 'darwin': // macOS: ~/Library/Logs/{appname} - return path.join(theApp.getPath('home'), 'Library/Logs', theApp.getName()); + return path.join(theApp.getPath('home'), 'Library/Logs', theApp.name); default: // Windows: %LOCALAPPDATA%\{appname}\logs // Linux: ~/.config/{appname}/logs |
