Skip to content

Commit

Permalink
Fix deprecated Electron APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
pronebird committed Jan 27, 2020
1 parent 989b58e commit 64abc03
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions gui/src/main/index.ts
Expand Up @@ -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');
}
Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion gui/src/main/notification-controller.ts
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion gui/src/shared/logging.ts
Expand Up @@ -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
Expand Down

0 comments on commit 64abc03

Please sign in to comment.