mirror of
https://github.com/gnmyt/myspeed.git
synced 2026-02-14 01:28:39 -06:00
The StatusContext.jsx now supports the 'running'-field & runs every 5 seconds
This commit is contained in:
@@ -4,7 +4,7 @@ export const StatusContext = createContext();
|
||||
|
||||
export const StatusProvider = (props) => {
|
||||
|
||||
const [status, setStatus] = useState({paused: false});
|
||||
const [status, setStatus] = useState({paused: false, running: false});
|
||||
|
||||
const updateStatus = () => {
|
||||
let headers = localStorage.getItem("password") ? {password: localStorage.getItem("password")} : {}
|
||||
@@ -15,7 +15,7 @@ export const StatusProvider = (props) => {
|
||||
|
||||
useEffect(() => {
|
||||
updateStatus();
|
||||
const interval = setInterval(() => updateStatus(), 15000);
|
||||
const interval = setInterval(() => updateStatus(), 5000);
|
||||
return () => clearInterval(interval);
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user