Skip to content

Commit

Permalink
code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
marcopiovanello committed Dec 19, 2024
1 parent 9d3861a commit 17fb608
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/views/Livestream.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import {
Paper,
Table, TableBody, TableCell, TableContainer, TableHead, TableRow
} from '@mui/material'
import { useAtomValue } from 'jotai'
import { useState } from 'react'
import { interval } from 'rxjs'
import { rpcPollingTimeState } from '../atoms/rpc'
import LivestreamDialog from '../components/livestream/LivestreamDialog'
import LivestreamSpeedDial from '../components/livestream/LivestreamSpeedDial'
import NoLivestreams from '../components/livestream/NoLivestreams'
Expand All @@ -24,7 +26,9 @@ const LiveStreamMonitorView: React.FC = () => {
const [progress, setProgress] = useState<LiveStreamProgress>()
const [openDialog, setOpenDialog] = useState(false)

useSubscription(interval(1000), () => {
const rpcPollingRate = useAtomValue(rpcPollingTimeState)

useSubscription(interval(rpcPollingRate), () => {
client
.progressLivestream()
.then(r => setProgress(r.result))
Expand Down

0 comments on commit 17fb608

Please sign in to comment.