Skip to content

Commit

Permalink
fix(frontend/presenter): only go to navigator via hotkey if there are…
Browse files Browse the repository at this point in the history
… lines
  • Loading branch information
Harjot1Singh committed Jul 13, 2020
1 parent 6ab8ccf commit 3dca681
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/frontend/src/Presenter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
} from '../lib/consts'
import { GLOBAL_SHORTCUTS } from '../lib/keyMap'
import { SettingsContext } from '../lib/contexts'
import { useCurrentLines } from '../lib/hooks'

import ThemeLoader from '../shared/ThemeLoader'
import Loader from '../shared/Loader'
Expand Down Expand Up @@ -67,6 +68,8 @@ const Presenter = () => {
const onIdle = () => setIdle( true )
const onActive = () => setIdle( false )

const lines = useCurrentLines()

const isControllerOpen = pathname.includes( CONTROLLER_URL )

/**
Expand Down Expand Up @@ -141,7 +144,7 @@ const Presenter = () => {
[ GLOBAL_SHORTCUTS.search.name ]: () => go( SEARCH_URL ),
[ GLOBAL_SHORTCUTS.history.name ]: () => go( HISTORY_URL ),
[ GLOBAL_SHORTCUTS.bookmarks.name ]: () => go( BOOKMARKS_URL ),
[ GLOBAL_SHORTCUTS.navigator.name ]: () => go( NAVIGATOR_URL ),
[ GLOBAL_SHORTCUTS.navigator.name ]: () => lines.length && go( NAVIGATOR_URL ),
[ GLOBAL_SHORTCUTS.clearDisplay.name ]: controller.clear,
[ GLOBAL_SHORTCUTS.toggleFullscreenController.name ]: toggleFullscreenController,
[ GLOBAL_SHORTCUTS.toggleFullscreen.name ]: toggleFullscreen,
Expand Down

0 comments on commit 3dca681

Please sign in to comment.