Skip to content

Commit 5b64167

Browse files
authored
Merge pull request #455 from codomposer/fix/incorrect_random_function
fix incorrect random function to accept min/max parameters
2 parents a23f505 + 6ecf9b5 commit 5b64167

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/views/dashboard/MainChart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const MainChart = () => {
2929
return () => document.documentElement.removeEventListener('ColorSchemeChange', handleColorSchemeChange)
3030
}, [chartRef])
3131

32-
const random = () => Math.round(Math.random() * 100)
32+
const random = (min = 0, max = 100) => Math.floor(Math.random() * (max - min + 1)) + min
3333

3434
return (
3535
<>

0 commit comments

Comments
 (0)