diff options
author | 2024-04-19 09:02:56 +0530 | |
---|---|---|
committer | 2024-04-19 03:52:01 +0000 | |
commit | 03a12413d632a2a1613091e44c52ce46b4adc5b8 (patch) | |
tree | 0086e0f98a644df91644b9cdde5ca1515188113a /src/components/services/tabs | |
parent | 6.7.3-nightly.13 [skip ci] (diff) | |
download | ferdium-app-03a12413d632a2a1613091e44c52ce46b4adc5b8.tar.gz ferdium-app-03a12413d632a2a1613091e44c52ce46b4adc5b8.tar.zst ferdium-app-03a12413d632a2a1613091e44c52ce46b4adc5b8.zip |
Minor refactoring to move repeated code into utility class
Diffstat (limited to 'src/components/services/tabs')
-rw-r--r-- | src/components/services/tabs/TabItem.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/services/tabs/TabItem.tsx b/src/components/services/tabs/TabItem.tsx index bf193e136..0e999506a 100644 --- a/src/components/services/tabs/TabItem.tsx +++ b/src/components/services/tabs/TabItem.tsx | |||
@@ -19,7 +19,7 @@ import globalMessages from '../../../i18n/globalMessages'; | |||
19 | import type Service from '../../../models/Service'; | 19 | import type Service from '../../../models/Service'; |
20 | import Icon from '../../ui/icon'; | 20 | import Icon from '../../ui/icon'; |
21 | import MenuItemConstructorOptions = Electron.MenuItemConstructorOptions; | 21 | import MenuItemConstructorOptions = Electron.MenuItemConstructorOptions; |
22 | import { acceleratorString } from '../../../jsUtils'; | 22 | import { acceleratorString, isShiftKeyPress } from '../../../jsUtils'; |
23 | 23 | ||
24 | const IS_SERVICE_DEBUGGING_ENABLED = ( | 24 | const IS_SERVICE_DEBUGGING_ENABLED = ( |
25 | localStorage.getItem('debug') || '' | 25 | localStorage.getItem('debug') || '' |
@@ -171,8 +171,8 @@ class TabItem extends Component<IProps, IState> { | |||
171 | ); | 171 | ); |
172 | } | 172 | } |
173 | 173 | ||
174 | handleShortcutIndex = (event, showShortcutIndex = true) => { | 174 | handleShortcutIndex = (event: KeyboardEvent, showShortcutIndex = true) => { |
175 | if (event.key === 'Shift') { | 175 | if (isShiftKeyPress(event.key)) { |
176 | this.setState({ showShortcutIndex }); | 176 | this.setState({ showShortcutIndex }); |
177 | } | 177 | } |
178 | }; | 178 | }; |