summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/components/KeyboardNavigation.tsx
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2021-06-29 14:51:55 +0200
committerOskar Nyberg <oskar@mullvad.net>2021-07-01 11:37:59 +0200
commit93f6361d14031d9644d6677c8eb51bf67e288666 (patch)
tree0e2a3c4ac9efa179a7b3383b4104c705675578ac /gui/src/renderer/components/KeyboardNavigation.tsx
parent7b8697683a00a2a1dff9ad68e1b4d500f1d02a80 (diff)
downloadmullvadvpn-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.tsx7
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],