From 95df3522a15631abc51a4295cae0ea401a8d4e1e Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Tue, 14 Sep 2021 19:58:52 +0200 Subject: feat: add eslint-plugin-unicorn (#1936) --- src/lib/Menu.js | 38 +++++++++++++++++++------------------- src/lib/TouchBar.js | 8 ++++---- 2 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src/lib') diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 8e2d8bdca..563db087b 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js @@ -952,7 +952,7 @@ class FranzMenu { }, ); - services.allDisplayed.forEach((service, i) => + for (const [i, service] of services.allDisplayed.entries()) { menu.push({ label: this._getServiceName(service), accelerator: i < 9 ? `${cmdOrCtrlShortcutKey()}+${i + 1}` : null, @@ -965,8 +965,8 @@ class FranzMenu { app.mainWindow.restore(); } }, - }), - ); + }); + } if ( services.active && @@ -1018,23 +1018,23 @@ class FranzMenu { }); } - menu.push({ - type: 'separator', - }); - - // Default workspace - menu.push({ - label: intl.formatMessage(menuItems.defaultWorkspace), - accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+0`, - type: 'radio', - checked: !activeWorkspace, - click: () => { - workspaceActions.deactivate(); + menu.push( + { + type: 'separator', }, - }); + { + label: intl.formatMessage(menuItems.defaultWorkspace), + accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+0`, + type: 'radio', + checked: !activeWorkspace, + click: () => { + workspaceActions.deactivate(); + }, + }, + ); // Workspace items - workspaces.forEach((workspace, i) => + for (const [i, workspace] of workspaces.entries()) { menu.push({ label: workspace.name, accelerator: @@ -1044,8 +1044,8 @@ class FranzMenu { click: () => { workspaceActions.activate({ workspace }); }, - }), - ); + }); + } return menu; } diff --git a/src/lib/TouchBar.js b/src/lib/TouchBar.js index 3397afdb2..c80931200 100644 --- a/src/lib/TouchBar.js +++ b/src/lib/TouchBar.js @@ -15,8 +15,8 @@ export default class FranzTouchBar { if (isMac && semver.gt(osRelease, '16.6.0')) { this.build = autorun(this._build.bind(this)); } - } catch (err) { - console.error(err); + } catch (error) { + console.error(error); } } @@ -27,7 +27,7 @@ export default class FranzTouchBar { const { TouchBarButton, TouchBarSpacer } = TouchBar; const buttons = []; - this.stores.services.allDisplayed.forEach(((service) => { + for (const service of this.stores.services.allDisplayed) { buttons.push(new TouchBarButton({ label: `${service.name}${service.unreadDirectMessageCount > 0 ? ' 🔴' : ''} ${service.unreadDirectMessageCount === 0 @@ -38,7 +38,7 @@ export default class FranzTouchBar { this.actions.service.setActive({ serviceId: service.id }); }, }), new TouchBarSpacer({ size: 'small' })); - })); + } const touchBar = new TouchBar({ items: buttons }); currentWindow.setTouchBar(touchBar); -- cgit v1.2.3-70-g09d2