diff --git a/app/main/index.ts b/app/main/index.ts index 82d5c0c1..3993448a 100644 --- a/app/main/index.ts +++ b/app/main/index.ts @@ -200,7 +200,7 @@ app.on('ready', () => { // Auto-hide menu bar on Windows + Linux if (process.platform !== 'darwin') { const shouldHideMenu = ConfigUtil.getConfigItem('autoHideMenubar') || false; - mainWindow.setAutoHideMenuBar(shouldHideMenu); + mainWindow.autoHideMenuBar = shouldHideMenu; mainWindow.setMenuBarVisibility(!shouldHideMenu); } @@ -298,7 +298,7 @@ app.on('ready', () => { }); ipcMain.on('toggle-menubar', (_event: Electron.IpcMainEvent, showMenubar: boolean) => { - mainWindow.setAutoHideMenuBar(showMenubar); + mainWindow.autoHideMenuBar = showMenubar; mainWindow.setMenuBarVisibility(!showMenubar); page.send('toggle-autohide-menubar', showMenubar, true); }); diff --git a/app/main/menu.ts b/app/main/menu.ts index 48f9f01e..b5eb0b02 100644 --- a/app/main/menu.ts +++ b/app/main/menu.ts @@ -10,7 +10,7 @@ import Logger = require('../renderer/js/utils/logger-util'); import ConfigUtil = require('../renderer/js/utils/config-util'); import t = require('../renderer/js/utils/translation-util'); -const appName = app.getName(); +const appName = app.name; const logger = new Logger({ file: 'errors.log', @@ -179,7 +179,7 @@ class AppMenu { click(_item: any, focusedWindow: any) { if (focusedWindow) { const newValue = !ConfigUtil.getConfigItem('autoHideMenubar'); - focusedWindow.setAutoHideMenuBar(newValue); + focusedWindow.autoHideMenuBar = newValue; focusedWindow.setMenuBarVisibility(!newValue); focusedWindow.webContents.send('toggle-autohide-menubar', newValue); ConfigUtil.setConfigItem('autoHideMenubar', newValue); @@ -287,7 +287,7 @@ class AppMenu { const { tabs, activeTabIndex, enableMenu } = props; return [{ - label: `${app.getName()}`, + label: app.name, submenu: [{ label: t.__('Add Organization'), accelerator: 'Cmd+Shift+N', diff --git a/app/renderer/js/pages/preference/badge-settings.ts b/app/renderer/js/pages/preference/badge-settings.ts index 771cf5ad..32fabdfc 100644 --- a/app/renderer/js/pages/preference/badge-settings.ts +++ b/app/renderer/js/pages/preference/badge-settings.ts @@ -22,13 +22,13 @@ class BadgeSettings { this.updateOverlayIcon(messageCount, mainWindow); } else { // This should work on both macOS and Linux - app.setBadgeCount(messageCount); + app.badgeCount = messageCount; } } hideBadgeCount(mainWindow: electron.BrowserWindow): void { if (process.platform === 'darwin') { - app.setBadgeCount(0); + app.badgeCount = 0; } if (process.platform === 'win32') { mainWindow.setOverlayIcon(null, ''); diff --git a/app/renderer/js/pages/preference/general-section.ts b/app/renderer/js/pages/preference/general-section.ts index ab4723f6..984376e5 100644 --- a/app/renderer/js/pages/preference/general-section.ts +++ b/app/renderer/js/pages/preference/general-section.ts @@ -385,7 +385,7 @@ class GeneralSection extends BaseSection { async clearAppDataDialog(): Promise { const clearAppDataMessage = 'By clicking proceed you will be removing all added accounts and preferences from Zulip. When the application restarts, it will be as if you are starting Zulip for the first time.'; - const getAppPath = path.join(app.getPath('appData'), app.getName()); + const getAppPath = path.join(app.getPath('appData'), app.name); const { response } = await dialog.showMessageBox({ type: 'warning',