This commit is contained in:
Daniel Shleifman
2021-06-15 11:10:01 +03:00
parent 62055a2a39
commit 66602f8344

View File

@@ -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>
)} )}