diff --git a/web/src/components/Add/index.jsx b/web/src/components/Add/index.jsx index 5a92c86..8b449d9 100644 --- a/web/src/components/Add/index.jsx +++ b/web/src/components/Add/index.jsx @@ -12,6 +12,7 @@ export default function AddDialogButton() { const [isDialogOpen, setIsDialogOpen] = useState(false) const handleClickOpen = () => setIsDialogOpen(true) const handleClose = () => setIsDialogOpen(false) + return (
diff --git a/web/src/components/DialogTorrentDetailsContent/DialogHeader.jsx b/web/src/components/DialogTorrentDetailsContent/DialogHeader.jsx index e79569a..9b44400 100644 --- a/web/src/components/DialogTorrentDetailsContent/DialogHeader.jsx +++ b/web/src/components/DialogTorrentDetailsContent/DialogHeader.jsx @@ -10,9 +10,8 @@ const useStyles = makeStyles(theme => ({ })) export default function DialogHeader({ title, onClose, onBack }) { - const classes = useStyles() - // eslint-disable-next-line no-unused-vars const { t } = useTranslation() + const classes = useStyles() return ( diff --git a/web/src/components/DialogTorrentDetailsContent/Table/index.jsx b/web/src/components/DialogTorrentDetailsContent/Table/index.jsx index e2434b0..1ae46b4 100644 --- a/web/src/components/DialogTorrentDetailsContent/Table/index.jsx +++ b/web/src/components/DialogTorrentDetailsContent/Table/index.jsx @@ -12,14 +12,13 @@ const { memo } = require('react') const Table = memo( ({ playableFileList, viewedFileList, selectedSeason, seasonAmount, hash }) => { + const { t } = useTranslation() const preloadBuffer = fileId => fetch(`${streamHost()}?link=${hash}&index=${fileId}&preload`) const getFileLink = (path, id) => `${streamHost()}/${encodeURIComponent(path.split('\\').pop().split('/').pop())}?link=${hash}&index=${id}&play` const fileHasEpisodeText = !!playableFileList?.find(({ path }) => ptt.parse(path).episode) const fileHasSeasonText = !!playableFileList?.find(({ path }) => ptt.parse(path).season) const fileHasResolutionText = !!playableFileList?.find(({ path }) => ptt.parse(path).resolution) - // eslint-disable-next-line no-unused-vars - const { t } = useTranslation() return !playableFileList?.length ? ( 'No playable files in this torrent' diff --git a/web/src/components/DialogTorrentDetailsContent/TorrentFunctions/index.jsx b/web/src/components/DialogTorrentDetailsContent/TorrentFunctions/index.jsx index 819fd79..ba2f9c4 100644 --- a/web/src/components/DialogTorrentDetailsContent/TorrentFunctions/index.jsx +++ b/web/src/components/DialogTorrentDetailsContent/TorrentFunctions/index.jsx @@ -11,6 +11,7 @@ import { SectionSubName } from '../style' const TorrentFunctions = memo( ({ hash, viewedFileList, playableFileList, name, title, setViewedFileList }) => { + const { t } = useTranslation() const latestViewedFileId = viewedFileList?.[viewedFileList?.length - 1] const latestViewedFile = playableFileList?.find(({ id }) => id === latestViewedFileId)?.path const isOnlyOnePlayableFile = playableFileList?.length === 1 @@ -20,8 +21,6 @@ const TorrentFunctions = memo( axios.post(viewedHost(), { action: 'rem', hash, file_index: -1 }).then(() => setViewedFileList()) const fullPlaylistLink = `${playlistTorrHost()}/${encodeURIComponent(name || title || 'file')}.m3u?link=${hash}&m3u` const partialPlaylistLink = `${fullPlaylistLink}&fromlast` - // eslint-disable-next-line no-unused-vars - const { t } = useTranslation() return ( <> diff --git a/web/src/components/DialogTorrentDetailsContent/index.jsx b/web/src/components/DialogTorrentDetailsContent/index.jsx index 7c78ed6..e1cdd42 100644 --- a/web/src/components/DialogTorrentDetailsContent/index.jsx +++ b/web/src/components/DialogTorrentDetailsContent/index.jsx @@ -38,6 +38,7 @@ const Loader = () => ( ) export default function DialogTorrentDetailsContent({ closeDialog, torrent }) { + const { t } = useTranslation() const [isLoading, setIsLoading] = useState(true) const [isDetailedCacheView, setIsDetailedCacheView] = useState(false) const [viewedFileList, setViewedFileList] = useState() @@ -45,9 +46,6 @@ export default function DialogTorrentDetailsContent({ closeDialog, torrent }) { const [seasonAmount, setSeasonAmount] = useState(null) const [selectedSeason, setSelectedSeason] = useState() - // eslint-disable-next-line no-unused-vars - const { t } = useTranslation() - const { poster, hash, diff --git a/web/src/components/Donate/DonateDialog.jsx b/web/src/components/Donate/DonateDialog.jsx index e01b04c..4c5c98c 100644 --- a/web/src/components/Donate/DonateDialog.jsx +++ b/web/src/components/Donate/DonateDialog.jsx @@ -12,8 +12,8 @@ const donateFrame = '' export default function DonateDialog({ onClose }) { - // eslint-disable-next-line no-unused-vars const { t } = useTranslation() + return ( {t('Donate')} diff --git a/web/src/components/RemoveAll.jsx b/web/src/components/RemoveAll.jsx index 08a0445..be9c719 100644 --- a/web/src/components/RemoveAll.jsx +++ b/web/src/components/RemoveAll.jsx @@ -32,11 +32,10 @@ const fnRemoveAll = () => { } export default function RemoveAll() { + const { t } = useTranslation() const [open, setOpen] = useState(false) const closeDialog = () => setOpen(false) const openDialog = () => setOpen(true) - // eslint-disable-next-line no-unused-vars - const { t } = useTranslation() return ( <> diff --git a/web/src/components/Settings.jsx b/web/src/components/Settings.jsx index 414e46b..2a2a5ef 100644 --- a/web/src/components/Settings.jsx +++ b/web/src/components/Settings.jsx @@ -15,6 +15,7 @@ import { settingsHost, setTorrServerHost, getTorrServerHost } from 'utils/Hosts' import { useTranslation } from 'react-i18next' export default function SettingsDialog() { + const { t } = useTranslation() const [open, setOpen] = useState(false) const [settings, setSets] = useState({}) const [show, setShow] = useState(false) @@ -28,8 +29,6 @@ export default function SettingsDialog() { sets.CacheSize *= 1024 * 1024 axios.post(settingsHost(), { action: 'set', sets }) } - // eslint-disable-next-line no-unused-vars - const { t } = useTranslation() useEffect(() => { axios diff --git a/web/src/components/TorrentCard/index.jsx b/web/src/components/TorrentCard/index.jsx index 67b88ac..b9abfa6 100644 --- a/web/src/components/TorrentCard/index.jsx +++ b/web/src/components/TorrentCard/index.jsx @@ -17,7 +17,6 @@ import { StyledButton, TorrentCard, TorrentCardButtons, TorrentCardDescription, const Transition = forwardRef((props, ref) => ) export default function Torrent({ torrent }) { - // eslint-disable-next-line no-unused-vars const { t } = useTranslation() const [isDetailedInfoOpened, setIsDetailedInfoOpened] = useState(false) const [isDeleteTorrentOpened, setIsDeleteTorrentOpened] = useState(false)