mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-25 17:36:18 -05:00
Copying some settings values to status to avoid calling both /settings and /status.
This commit is contained in:
parent
78218d3559
commit
dbdcc7a57c
10 changed files with 105 additions and 68 deletions
|
|
@ -656,6 +656,19 @@ export const useStatus = () => {
|
|||
return {status, fetchStatus}
|
||||
}
|
||||
|
||||
export const useStatusInterval = () => {
|
||||
const {status, fetchStatus} = useStatus();
|
||||
|
||||
useEffect(() => {
|
||||
const interval = setInterval(() => {
|
||||
fetchStatus();
|
||||
}, 1000 * 3);
|
||||
return () => clearInterval(interval);
|
||||
}, []);
|
||||
|
||||
return {status, fetchStatus};
|
||||
}
|
||||
|
||||
export const useVideoStatistics = () => {
|
||||
const [statistics, setStatistics] = useState({});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue