diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2021-06-29 14:51:55 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2021-07-01 11:37:59 +0200 |
| commit | 93f6361d14031d9644d6677c8eb51bf67e288666 (patch) | |
| tree | 0e2a3c4ac9efa179a7b3383b4104c705675578ac /gui/src/renderer/components/KeyboardNavigation.tsx | |
| parent | 7b8697683a00a2a1dff9ad68e1b4d500f1d02a80 (diff) | |
| download | mullvadvpn-93f6361d14031d9644d6677c8eb51bf67e288666.tar.xz mullvadvpn-93f6361d14031d9644d6677c8eb51bf67e288666.zip | |
Adjust all uses of history to use the new methods
Diffstat (limited to 'gui/src/renderer/components/KeyboardNavigation.tsx')
| -rw-r--r-- | gui/src/renderer/components/KeyboardNavigation.tsx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gui/src/renderer/components/KeyboardNavigation.tsx b/gui/src/renderer/components/KeyboardNavigation.tsx index 3aefd7c684..94b5097389 100644 --- a/gui/src/renderer/components/KeyboardNavigation.tsx +++ b/gui/src/renderer/components/KeyboardNavigation.tsx @@ -1,18 +1,17 @@ import React, { useCallback, useEffect } from 'react'; -import { useHistory } from 'react-router'; -import History from '../lib/history'; +import { useHistory } from '../lib/history'; interface IKeyboardNavigationProps { children: React.ReactElement; } export default function KeyboardNavigation(props: IKeyboardNavigationProps) { - const history = useHistory() as History; + const history = useHistory(); const handleKeyDown = useCallback( (event: KeyboardEvent) => { if (event.key === 'Escape') { - history.reset(); + history.dismiss(true); } }, [history.reset], |
