mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
refactor
This commit is contained in:
@@ -19,7 +19,7 @@ const getTorrents = async () => {
|
|||||||
|
|
||||||
export default function TorrentList() {
|
export default function TorrentList() {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const [isOffline, setIsOffline] = useState(true)
|
const [isOffline, setIsOffline] = useState(false)
|
||||||
const { data: torrents, isLoading } = useQuery('torrents', getTorrents, {
|
const { data: torrents, isLoading } = useQuery('torrents', getTorrents, {
|
||||||
retry: 1,
|
retry: 1,
|
||||||
refetchInterval: 1000,
|
refetchInterval: 1000,
|
||||||
@@ -30,10 +30,10 @@ export default function TorrentList() {
|
|||||||
if (isLoading || isOffline || !torrents.length) {
|
if (isLoading || isOffline || !torrents.length) {
|
||||||
return (
|
return (
|
||||||
<CenteredGrid>
|
<CenteredGrid>
|
||||||
{isLoading ? (
|
{isOffline ? (
|
||||||
<CircularProgress />
|
|
||||||
) : isOffline ? (
|
|
||||||
<Typography>{t('Offline')}</Typography>
|
<Typography>{t('Offline')}</Typography>
|
||||||
|
) : isLoading ? (
|
||||||
|
<CircularProgress />
|
||||||
) : (
|
) : (
|
||||||
!torrents.length && <Typography>{t('NoTorrentsAdded')}</Typography>
|
!torrents.length && <Typography>{t('NoTorrentsAdded')}</Typography>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user