Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 3419b56

Browse files
authored
Merge pull request #9 from highmobility/feature/refresh-with-r
add option to refresh data with "R" button
2 parents e3713a2 + 5572ac3 commit 3419b56

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

client/src/components/DashboardPage.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { VIEWS } from '../store/Config'
1313
import { useInterval } from 'react-use'
1414
import DashboardMap from './DashboardMap'
1515
import ErrorMessage from './ErrorMessage'
16+
import { useKeyPressEvent } from 'react-use'
1617

1718
function DashboardPage() {
1819
const [initialDataFetched, setInitialDataFetched] = useState(false)
@@ -137,6 +138,10 @@ function DashboardPage() {
137138
config.selectedVehicleId ? config.updateFrequency * 1000 : null
138139
)
139140

141+
useKeyPressEvent('r', () => {
142+
fetchData()
143+
})
144+
140145
const renderContent = () => {
141146
if (!vehiclesFetched) return <Spinner />
142147
if (vehicles.list.length === 0) {

0 commit comments

Comments
 (0)