Add keyboard shortcut to settings (#1368)
This commit is contained in:
@ -34,6 +34,8 @@ import { useCommandsContext } from 'hooks/useCommandsContext'
|
||||
import { DEFAULT_PROJECT_NAME } from 'machines/settingsMachine'
|
||||
import { sep } from '@tauri-apps/api/path'
|
||||
import { homeCommandBarConfig } from 'lib/commandBarConfigs/homeCommandConfig'
|
||||
import { useHotkeys } from 'react-hotkeys-hook'
|
||||
import { isTauri } from 'lib/isTauri'
|
||||
|
||||
// This route only opens in the Tauri desktop context for now,
|
||||
// as defined in Router.tsx, so we can use the Tauri APIs and types.
|
||||
@ -60,6 +62,13 @@ const Home = () => {
|
||||
})
|
||||
}
|
||||
}, [])
|
||||
useHotkeys(
|
||||
isTauri() ? 'mod+,' : 'shift+mod+,',
|
||||
() => navigate(paths.HOME + paths.SETTINGS),
|
||||
{
|
||||
splitKey: '|',
|
||||
}
|
||||
)
|
||||
|
||||
const [state, send] = useMachine(homeMachine, {
|
||||
context: {
|
||||
|
Reference in New Issue
Block a user