diff options
author | 2023-05-28 22:11:03 +0530 | |
---|---|---|
committer | 2023-05-28 22:25:33 +0530 | |
commit | b631f0f664dc85c81032b02eebdd8eb1e8796a81 (patch) | |
tree | e4a50a32f7836953c0a6af34389fe9898e24215a /src/components/services/tabs | |
parent | Fix issues reported by sonarqube linter (diff) | |
download | ferdium-app-b631f0f664dc85c81032b02eebdd8eb1e8796a81.tar.gz ferdium-app-b631f0f664dc85c81032b02eebdd8eb1e8796a81.tar.zst ferdium-app-b631f0f664dc85c81032b02eebdd8eb1e8796a81.zip |
Allow the 10th service to also be accessible via keyboard shortcut combo
Diffstat (limited to 'src/components/services/tabs')
-rw-r--r-- | src/components/services/tabs/TabItem.tsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/components/services/tabs/TabItem.tsx b/src/components/services/tabs/TabItem.tsx index 289597db9..c883066ce 100644 --- a/src/components/services/tabs/TabItem.tsx +++ b/src/components/services/tabs/TabItem.tsx | |||
@@ -15,6 +15,7 @@ import globalMessages from '../../../i18n/globalMessages'; | |||
15 | import Icon from '../../ui/icon'; | 15 | import Icon from '../../ui/icon'; |
16 | import { Stores } from '../../../@types/stores.types'; | 16 | import { Stores } from '../../../@types/stores.types'; |
17 | import MenuItemConstructorOptions = Electron.MenuItemConstructorOptions; | 17 | import MenuItemConstructorOptions = Electron.MenuItemConstructorOptions; |
18 | import { acceleratorString } from '../../../jsUtils'; | ||
18 | 19 | ||
19 | const IS_SERVICE_DEBUGGING_ENABLED = ( | 20 | const IS_SERVICE_DEBUGGING_ENABLED = ( |
20 | localStorage.getItem('debug') || '' | 21 | localStorage.getItem('debug') || '' |
@@ -358,11 +359,10 @@ class TabItem extends Component<IProps, IState> { | |||
358 | onKeyDown={noop} | 359 | onKeyDown={noop} |
359 | role="presentation" | 360 | role="presentation" |
360 | onContextMenu={() => menu.popup()} | 361 | onContextMenu={() => menu.popup()} |
361 | data-tip={`${service.name} ${ | 362 | data-tip={`${service.name} ${acceleratorString( |
362 | shortcutIndex <= 9 | 363 | shortcutIndex, |
363 | ? `(${cmdOrCtrlShortcutKey(false)}+${shortcutIndex})` | 364 | cmdOrCtrlShortcutKey(false), |
364 | : '' | 365 | )}`} |
365 | }`} | ||
366 | > | 366 | > |
367 | <img src={service.icon} className="tab-item__icon" alt="" /> | 367 | <img src={service.icon} className="tab-item__icon" alt="" /> |
368 | {showServiceNameSetting && ( | 368 | {showServiceNameSetting && ( |
@@ -407,8 +407,8 @@ class TabItem extends Component<IProps, IState> { | |||
407 | /> | 407 | /> |
408 | </> | 408 | </> |
409 | )} | 409 | )} |
410 | {shortcutIndex <= 9 && this.state.showShortcutIndex && ( | 410 | {shortcutIndex <= 10 && this.state.showShortcutIndex && ( |
411 | <span className="tab-item__shortcut-index">{shortcutIndex}</span> | 411 | <span className="tab-item__shortcut-index">{shortcutIndex % 10}</span> |
412 | )} | 412 | )} |
413 | </li> | 413 | </li> |
414 | ); | 414 | ); |