Skip to content

Commit

Permalink
Change refresh data hotkey
Browse files Browse the repository at this point in the history
  • Loading branch information
hulxv committed Jan 5, 2022
1 parent fe2f5ca commit 8fdf285
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/shortcuts.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
| Key | Description |
| ------------------------------ | ---------------------------- |
| <kbd>ctrl</kbd> + <kbd>s</kbd> | Open Settings Modal |
| <kbd>ctrl</kbd> + <kbd>r</kbd> | Refresh data |
| <kbd>alt</kbd> + <kbd>r</kbd> | Refresh data |
| <kbd>ctrl</kbd> + <kbd>l</kbd> | Switch display to line chart |
| <kbd>ctrl</kbd> + <kbd>b</kbd> | Switch display to bar chart |
| <kbd>ctrl</kbd> + <kbd>t</kbd> | Switch display to table |
Expand Down
9 changes: 6 additions & 3 deletions renderer/components/NavigationBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
Flex,
Kbd,
Box,
HStack,
} from "@chakra-ui/react";
import { HiArrowSmDown, HiAdjustments, HiRefresh } from "react-icons/hi";

Expand Down Expand Up @@ -63,7 +64,7 @@ export default function NavigationBar() {
});
}, []);

useHotkeys("ctrl+r", () => {
useHotkeys("alt+r", () => {
reloadConfigs();
reloadingTrafficData();
router.replace(router.asPath);
Expand Down Expand Up @@ -99,7 +100,9 @@ export default function NavigationBar() {
<Export />
</Flex>
<Flex>
<Box>
<HStack mr={1}>
<Kbd>ALT</Kbd>
<span style={{ color: "white" }}>+</span>
<Kbd>R</Kbd>
<Tooltip label='Refresh'>
<IconButton
Expand All @@ -116,7 +119,7 @@ export default function NavigationBar() {
}}
/>
</Tooltip>
</Box>
</HStack>

<Menu>
<Tooltip label='Interval'>
Expand Down

0 comments on commit 8fdf285

Please sign in to comment.