diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Menu.js | 38 | ||||
-rw-r--r-- | src/lib/TouchBar.js | 8 |
2 files changed, 23 insertions, 23 deletions
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 { | |||
952 | }, | 952 | }, |
953 | ); | 953 | ); |
954 | 954 | ||
955 | services.allDisplayed.forEach((service, i) => | 955 | for (const [i, service] of services.allDisplayed.entries()) { |
956 | menu.push({ | 956 | menu.push({ |
957 | label: this._getServiceName(service), | 957 | label: this._getServiceName(service), |
958 | accelerator: i < 9 ? `${cmdOrCtrlShortcutKey()}+${i + 1}` : null, | 958 | accelerator: i < 9 ? `${cmdOrCtrlShortcutKey()}+${i + 1}` : null, |
@@ -965,8 +965,8 @@ class FranzMenu { | |||
965 | app.mainWindow.restore(); | 965 | app.mainWindow.restore(); |
966 | } | 966 | } |
967 | }, | 967 | }, |
968 | }), | 968 | }); |
969 | ); | 969 | } |
970 | 970 | ||
971 | if ( | 971 | if ( |
972 | services.active && | 972 | services.active && |
@@ -1018,23 +1018,23 @@ class FranzMenu { | |||
1018 | }); | 1018 | }); |
1019 | } | 1019 | } |
1020 | 1020 | ||
1021 | menu.push({ | 1021 | menu.push( |
1022 | type: 'separator', | 1022 | { |
1023 | }); | 1023 | type: 'separator', |
1024 | |||
1025 | // Default workspace | ||
1026 | menu.push({ | ||
1027 | label: intl.formatMessage(menuItems.defaultWorkspace), | ||
1028 | accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+0`, | ||
1029 | type: 'radio', | ||
1030 | checked: !activeWorkspace, | ||
1031 | click: () => { | ||
1032 | workspaceActions.deactivate(); | ||
1033 | }, | 1024 | }, |
1034 | }); | 1025 | { |
1026 | label: intl.formatMessage(menuItems.defaultWorkspace), | ||
1027 | accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+0`, | ||
1028 | type: 'radio', | ||
1029 | checked: !activeWorkspace, | ||
1030 | click: () => { | ||
1031 | workspaceActions.deactivate(); | ||
1032 | }, | ||
1033 | }, | ||
1034 | ); | ||
1035 | 1035 | ||
1036 | // Workspace items | 1036 | // Workspace items |
1037 | workspaces.forEach((workspace, i) => | 1037 | for (const [i, workspace] of workspaces.entries()) { |
1038 | menu.push({ | 1038 | menu.push({ |
1039 | label: workspace.name, | 1039 | label: workspace.name, |
1040 | accelerator: | 1040 | accelerator: |
@@ -1044,8 +1044,8 @@ class FranzMenu { | |||
1044 | click: () => { | 1044 | click: () => { |
1045 | workspaceActions.activate({ workspace }); | 1045 | workspaceActions.activate({ workspace }); |
1046 | }, | 1046 | }, |
1047 | }), | 1047 | }); |
1048 | ); | 1048 | } |
1049 | 1049 | ||
1050 | return menu; | 1050 | return menu; |
1051 | } | 1051 | } |
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 { | |||
15 | if (isMac && semver.gt(osRelease, '16.6.0')) { | 15 | if (isMac && semver.gt(osRelease, '16.6.0')) { |
16 | this.build = autorun(this._build.bind(this)); | 16 | this.build = autorun(this._build.bind(this)); |
17 | } | 17 | } |
18 | } catch (err) { | 18 | } catch (error) { |
19 | console.error(err); | 19 | console.error(error); |
20 | } | 20 | } |
21 | } | 21 | } |
22 | 22 | ||
@@ -27,7 +27,7 @@ export default class FranzTouchBar { | |||
27 | const { TouchBarButton, TouchBarSpacer } = TouchBar; | 27 | const { TouchBarButton, TouchBarSpacer } = TouchBar; |
28 | 28 | ||
29 | const buttons = []; | 29 | const buttons = []; |
30 | this.stores.services.allDisplayed.forEach(((service) => { | 30 | for (const service of this.stores.services.allDisplayed) { |
31 | buttons.push(new TouchBarButton({ | 31 | buttons.push(new TouchBarButton({ |
32 | label: `${service.name}${service.unreadDirectMessageCount > 0 | 32 | label: `${service.name}${service.unreadDirectMessageCount > 0 |
33 | ? ' 🔴' : ''} ${service.unreadDirectMessageCount === 0 | 33 | ? ' 🔴' : ''} ${service.unreadDirectMessageCount === 0 |
@@ -38,7 +38,7 @@ export default class FranzTouchBar { | |||
38 | this.actions.service.setActive({ serviceId: service.id }); | 38 | this.actions.service.setActive({ serviceId: service.id }); |
39 | }, | 39 | }, |
40 | }), new TouchBarSpacer({ size: 'small' })); | 40 | }), new TouchBarSpacer({ size: 'small' })); |
41 | })); | 41 | } |
42 | 42 | ||
43 | const touchBar = new TouchBar({ items: buttons }); | 43 | const touchBar = new TouchBar({ items: buttons }); |
44 | currentWindow.setTouchBar(touchBar); | 44 | currentWindow.setTouchBar(touchBar); |